aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-01-23 01:15:14 -0500
committerMike Frysinger <vapier@gentoo.org>2014-02-08 08:14:37 -0500
commit6fc8123f48680ddb6b40689a09c65488ee5bbd4b (patch)
treea6bda034ce36cb99f196471ad742f804218a1248
parent6349768c8b052e1ebdc1b9dcd2333decde6d80ff (diff)
downloadglibc-6fc8123f48680ddb6b40689a09c65488ee5bbd4b.zip
glibc-6fc8123f48680ddb6b40689a09c65488ee5bbd4b.tar.gz
glibc-6fc8123f48680ddb6b40689a09c65488ee5bbd4b.tar.bz2
sem_open: allow RAMFS_MAGIC for mount points
A ramfs mount supports the same requirements as a tmpfs, so accept that as a magic type too. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--nptl/ChangeLog4
-rw-r--r--nptl/sem_open.c6
2 files changed, 8 insertions, 2 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index a4d3f45..474a473 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,7 @@
+2014-02-08 Mike Frysinger <vapier@gentoo.org>
+
+ * sem_open.c (__where_is_shmfs): Compare f.f_type to RAMFS_MAGIC too.
+
2014-02-05 Carlos O'Donell <carlos@redhat.com>
* sysdeps/unix/sysv/linux/tst-setgetname.c (do_test): Skip the
diff --git a/nptl/sem_open.c b/nptl/sem_open.c
index 529f636..b57e6b7 100644
--- a/nptl/sem_open.c
+++ b/nptl/sem_open.c
@@ -61,7 +61,8 @@ __where_is_shmfs (void)
/* The canonical place is /dev/shm. This is at least what the
documentation tells everybody to do. */
- if (__statfs (defaultmount, &f) == 0 && f.f_type == SHMFS_SUPER_MAGIC)
+ if (__statfs (defaultmount, &f) == 0 && (f.f_type == SHMFS_SUPER_MAGIC
+ || f.f_type == RAMFS_MAGIC))
{
/* It is in the normal place. */
mountpoint.dir = (char *) defaultdir;
@@ -95,7 +96,8 @@ __where_is_shmfs (void)
/* First make sure this really is the correct entry. At least
some versions of the kernel give wrong information because
of the implicit mount of the shmfs for SysV IPC. */
- if (__statfs (mp->mnt_dir, &f) != 0 || f.f_type != SHMFS_SUPER_MAGIC)
+ if (__statfs (mp->mnt_dir, &f) != 0 || (f.f_type != SHMFS_SUPER_MAGIC
+ && f.f_type != RAMFS_MAGIC))
continue;
namelen = strlen (mp->mnt_dir);