[Spice-devel] [PATCH spice-protocol] Fix SPICE_STAT_SHM_NAME to be portable

Nahum Shalman nshalman at elys.com
Fri Jan 6 05:56:52 PST 2012


 From SHM_OPEN(3):
   For portable use, a shared memory object should be identified by a name
   of the  form  /somename; that is, a null-terminated string of up to
   NAME_MAX (i.e., 255) characters consisting of an initial slash,
   followed by one or more characters, none of which are slashes.
---
  spice/stats.h |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/spice/stats.h b/spice/stats.h
index eea5478..452d89e 100644
--- a/spice/stats.h
+++ b/spice/stats.h
@@ -33,7 +33,7 @@

  #include <spice/types.h>

-#define SPICE_STAT_SHM_NAME "spice.%u"
+#define SPICE_STAT_SHM_NAME "/spice.%u"
  #define SPICE_STAT_NODE_NAME_MAX 20
  #define SPICE_STAT_MAGIC (*(uint32_t*)"STAT")
  #define SPICE_STAT_VERSION 1
-- 
1.7.7.4



More information about the Spice-devel mailing list