From: Ulrich Drepper Date: Wed, 17 Nov 1999 20:36:43 +0000 (+0000) Subject: (__getpt): Check for devfs. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c34eb7a28e6ac1999f38ae7677f738322ae66e44;p=thirdparty%2Fglibc.git (__getpt): Check for devfs. --- diff --git a/sysdeps/unix/sysv/linux/getpt.c b/sysdeps/unix/sysv/linux/getpt.c index 511b9004c05..e6cfd18951c 100644 --- a/sysdeps/unix/sysv/linux/getpt.c +++ b/sysdeps/unix/sysv/linux/getpt.c @@ -27,6 +27,9 @@ /* Constant that identifies the `devpts' filesystem. */ #define DEVPTS_SUPER_MAGIC 0x1cd1 +/* Constant that identifies the `devfs' filesystem. */ +#define DEVFS_SUPER_MAGIC 0x1373 + /* Path to the master pseudo terminal cloning device. */ #define _PATH_DEVPTMX _PATH_DEV "ptmx" /* Directory containing the UNIX98 pseudo terminals. */ @@ -50,10 +53,13 @@ __getpt (void) struct statfs fsbuf; static int devpts_mounted; - /* Check that the /dev/pts filesystem is mounted. */ + /* Check that the /dev/pts filesystem is mounted + or if /dev is a devfs filesystem (this implies /dev/pts). */ if (devpts_mounted || (__statfs (_PATH_DEVPTS, &fsbuf) == 0 - && fsbuf.f_type == DEVPTS_SUPER_MAGIC)) + && fsbuf.f_type == DEVPTS_SUPER_MAGIC) + || (__statfs (_PATH_DEV, &fsbuf) == 0 + && fsbuf.f_type == DEVFS_SUPER_MAGIC)) { /* Everything is ok. */ devpts_mounted = 1;