diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-03-08 11:46:22 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-03-08 11:46:22 +0000 |
commit | 7d1de115db4c8b660d12ad1a72cb95ffa7f7a234 (patch) | |
tree | ca94f7d2b4d2e78a93ae8e653cd5ab5528fab2ed /sysdeps | |
parent | b74656f98231fc1d31f8200b3306e2d821ec2cf4 (diff) | |
download | glibc-7d1de115db4c8b660d12ad1a72cb95ffa7f7a234.tar.gz glibc-7d1de115db4c8b660d12ad1a72cb95ffa7f7a234.tar.xz glibc-7d1de115db4c8b660d12ad1a72cb95ffa7f7a234.zip |
Update.
1999-03-08 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * sysdeps/unix/sysv/linux/ttyname.c (ttyname): Undo last change. /dev/pts status may change during runtime. 1999-03-08 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * sysdeps/unix/sysv/linux/ttyname_r.c (__ttyname_r): Undo last change. /dev/pts status can change during runtime. 1999-03-07 Thorsten Kukuk <kukuk@suse.de> * sunrpc/svc_tcp.c (readtcp): go into fatal error state if poll reports error. * nis/nss_nisplus/nisplus-parser.c: Avoid duplicate strlen calls, add some more sanity checks. * nis/nss_nisplus/nisplus-pwd.c: Include nisplus-parser.h for parser prototype. 1999-03-05 Thorsten Kukuk <kukuk@suse.de> * sunrpc/rpc/xdr.h: Add x_getint32/x_putint32 to xdr_ops, change XDR_GETINT32/XDR_PUTINT32 to sue new functions. * sunrpc/xdr_mem.c: Add xdrmem_getint32, xdrmem_putint32. * sunrpc/xdr_rec.c: Add xdrrec_getint32, xdrrec_putint32. * sunrpc/xdr_sizeof.c: Add x_putint32, add dummy function for x_getint32. * sunrpc/xdr_stdio.c: Add xdrstdio_getint32, xdrstdio_putint32. * nis/nis_print.c: Fix ctime argument for platforms where sizeof (time_t) != sizeof (int). 255. Patch by Bruno Haible <haible@ilog.fr> [PR libc/1010].
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/unix/sysv/linux/ttyname.c | 22 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/ttyname_r.c | 25 |
2 files changed, 19 insertions, 28 deletions
diff --git a/sysdeps/unix/sysv/linux/ttyname.c b/sysdeps/unix/sysv/linux/ttyname.c index 9d345b8b94..20c794daf4 100644 --- a/sysdeps/unix/sysv/linux/ttyname.c +++ b/sysdeps/unix/sysv/linux/ttyname.c @@ -107,11 +107,10 @@ ttyname (fd) { static char *buf; static size_t buflen = 0; - static int dev_pts_available = 1; char procname[30]; struct stat st, st1; int dostat = 0; - char *name = NULL; + char *name; int save = errno; if (!__isatty (fd)) @@ -139,21 +138,18 @@ ttyname (fd) if (__fxstat (_STAT_VER, fd, &st) < 0) return NULL; - if (dev_pts_available) + if (__xstat (_STAT_VER, "/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode)) { - if (__xstat (_STAT_VER, "/dev/pts", &st1) == 0 && S_ISDIR (st1.st_mode)) - { #ifdef _STATBUF_ST_RDEV - name = getttyname ("/dev/pts", st.st_rdev, st.st_ino, save, &dostat); + name = getttyname ("/dev/pts", st.st_rdev, st.st_ino, save, &dostat); #else - name = getttyname ("/dev/pts", st.st_dev, st.st_ino, save, &dostat); + name = getttyname ("/dev/pts", st.st_dev, st.st_ino, save, &dostat); #endif - } - else - { - __set_errno (save); - dev_pts_available = 0; - } + } + else + { + __set_errno (save); + name = NULL; } if (!name && dostat != -1) diff --git a/sysdeps/unix/sysv/linux/ttyname_r.c b/sysdeps/unix/sysv/linux/ttyname_r.c index 3255ce3e00..b92c712fcc 100644 --- a/sysdeps/unix/sysv/linux/ttyname_r.c +++ b/sysdeps/unix/sysv/linux/ttyname_r.c @@ -103,7 +103,6 @@ __ttyname_r (fd, buf, buflen) char *buf; size_t buflen; { - static int dev_pts_available = 1; char procname[30]; struct stat st, st1; int dostat = 0; @@ -149,24 +148,20 @@ __ttyname_r (fd, buf, buflen) memcpy (buf, "/dev/pts/", sizeof ("/dev/pts/")); buflen -= sizeof ("/dev/pts/") - 1; - if (dev_pts_available) + if (__xstat (_STAT_VER, buf, &st1) == 0 && S_ISDIR (st1.st_mode)) { - if (__xstat (_STAT_VER, buf, &st1) == 0 && S_ISDIR (st1.st_mode)) - { #ifdef _STATBUF_ST_RDEV - ret = getttyname_r (buf, buflen, st.st_rdev, st.st_ino, save, - &dostat); + ret = getttyname_r (buf, buflen, st.st_rdev, st.st_ino, save, + &dostat); #else - ret = getttyname_r (buf, buflen, st.st_dev, st.st_ino, save, - &dostat); + ret = getttyname_r (buf, buflen, st.st_dev, st.st_ino, save, + &dostat); #endif - } - else - { - __set_errno (save); - ret = ENOENT; - dev_pts_available = 0; - } + } + else + { + __set_errno (save); + ret = ENOENT; } if (ret && dostat != -1) |