summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2007-05-25 18:56:28 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2007-05-25 18:56:28 +0000
commitcdbfc43a61c5e81a6ed9e483388916cb17b5cea8 (patch)
treebeb10fd9f36ec5e873ff43cebe1731e66843232e
parent6f6b281337639f2454deedd9512abc70afcf4ab6 (diff)
downloadATCD-cdbfc43a61c5e81a6ed9e483388916cb17b5cea8.tar.gz
Fri May 25 18:55:55 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--ACE/ChangeLog7
-rw-r--r--ACE/ace/OS_NS_sys_mman.inl46
2 files changed, 46 insertions, 7 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog
index 68a93fc77c2..85d53bb1505 100644
--- a/ACE/ChangeLog
+++ b/ACE/ChangeLog
@@ -1,3 +1,10 @@
+Fri May 25 18:55:55 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
+
+ * ace/OS_NS_sys_mman.inl (shm_open, shm_unlink):
+ With VxWorks the filename passed to shm_open and shm_unlink may
+ only contain a starting /, no other slashes, if multiple slashes
+ do exist, replace them with _.
+
Fri May 25 15:44:13 UTC 2007 Steve Huston <shuston@riverace.com>
* ace/config-aix-5.x.h:
diff --git a/ACE/ace/OS_NS_sys_mman.inl b/ACE/ace/OS_NS_sys_mman.inl
index cd9a65d5a84..f6b133d0253 100644
--- a/ACE/ace/OS_NS_sys_mman.inl
+++ b/ACE/ace/OS_NS_sys_mman.inl
@@ -238,27 +238,59 @@ ACE_OS::shm_open (const ACE_TCHAR *filename,
LPSECURITY_ATTRIBUTES sa)
{
ACE_OS_TRACE ("ACE_OS::shm_open");
-# if defined (ACE_HAS_SHM_OPEN)
+#if defined (ACE_HAS_SHM_OPEN)
ACE_UNUSED_ARG (sa);
+#if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x640)
+ // With VxWorks the file should just start with / and no other
+ // slashes, so replace all other / by _
+ ACE_TCHAR buf [MAXPATHLEN + 1];
+ ACE_OS::sprintf (buf,
+ ACE_LIB_TEXT ("%s"),
+ filename);
+ for (size_t i = 1; i < MAXPATHLEN + 1; i++)
+ {
+ if (buf[i] == '/')
+ {
+ buf[i] = '_';
+ }
+ }
+ filename = buf;
+#endif
ACE_OSCALL_RETURN (::shm_open (ACE_TEXT_ALWAYS_CHAR(filename), mode, perms), ACE_HANDLE, ACE_INVALID_HANDLE);
-# elif defined (ACE_OPENVMS)
+#elif defined (ACE_OPENVMS)
ACE_OSCALL_RETURN (::open (filename, mode, perms, ACE_TEXT("shr=get,put,upd")), ACE_HANDLE, ACE_INVALID_HANDLE);
-# else /* ! ACE_HAS_SHM_OPEN */
+#else /* ! ACE_HAS_SHM_OPEN */
// Just use ::open.
return ACE_OS::open (filename, mode, perms, sa);
-# endif /* ACE_HAS_SHM_OPEN */
+#endif /* ACE_HAS_SHM_OPEN */
}
ACE_INLINE int
ACE_OS::shm_unlink (const ACE_TCHAR *path)
{
ACE_OS_TRACE ("ACE_OS::shm_unlink");
-# if defined (ACE_HAS_SHM_OPEN)
+#if defined (ACE_HAS_SHM_OPEN)
+#if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x640)
+ // With VxWorks the file should just start with / and no other
+ // slashes, so replace all other / by _
+ ACE_TCHAR buf [MAXPATHLEN + 1];
+ ACE_OS::sprintf (buf,
+ ACE_LIB_TEXT ("%s"),
+ filename);
+ for (size_t i = 1; i < MAXPATHLEN + 1; i++)
+ {
+ if (buf[i] == '/')
+ {
+ buf[i] = '_';
+ }
+ }
+ filename = buf;
+#endif
ACE_OSCALL_RETURN (::shm_unlink (ACE_TEXT_ALWAYS_CHAR(path)), int, -1);
-# else /* ! ACE_HAS_SHM_OPEN */
+#else /* ! ACE_HAS_SHM_OPEN */
// Just use ::unlink.
return ACE_OS::unlink (path);
-# endif /* ACE_HAS_SHM_OPEN */
+#endif /* ACE_HAS_SHM_OPEN */
}
ACE_END_VERSIONED_NAMESPACE_DECL