summaryrefslogtreecommitdiff
path: root/libpthread/nptl
diff options
context:
space:
mode:
authorRoman I Khimov <khimov@altell.ru>2010-05-02 23:45:27 +0400
committerAustin Foxley <austinf@cetoncorp.com>2010-05-03 13:27:36 -0700
commit57d82892913019352bf8e35c5a3e9965e1df0e6b (patch)
tree686ceb6fbeb3bc2b4b8073f5523eca4b568b8afa /libpthread/nptl
parente769b83bc129210a25198c7de73272d8632923fa (diff)
nptl: fix sem_open with O_CREAT
Temporary file name template passed to __gen_tempname had no "XXXXXX" in it, so __gen_tempname returned EINVAL which led to sem_open failure. Fixes NPTL tests tst-sem4, tst-sem7, tst-sem8, tst-sem9. Signed-off-by: Roman I Khimov <khimov@altell.ru> Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libpthread/nptl')
-rw-r--r--libpthread/nptl/sem_open.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libpthread/nptl/sem_open.c b/libpthread/nptl/sem_open.c
index 8ded82cf1..28dd3aa90 100644
--- a/libpthread/nptl/sem_open.c
+++ b/libpthread/nptl/sem_open.c
@@ -333,7 +333,8 @@ sem_open (const char *name, int oflag, ...)
sizeof (sem_t) - sizeof (struct new_sem));
tmpfname = (char *) alloca (mountpoint.dirlen + 6 + 1);
- mempcpy (tmpfname, mountpoint.dir, mountpoint.dirlen);
+ mempcpy (mempcpy (tmpfname, mountpoint.dir, mountpoint.dirlen),
+ "XXXXXX", 7);
fd = __gen_tempname (tmpfname, __GT_FILE, mode);
if (fd == -1)