diff options
Diffstat (limited to 'sysdeps/posix/ttyname_r.c')
-rw-r--r-- | sysdeps/posix/ttyname_r.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sysdeps/posix/ttyname_r.c b/sysdeps/posix/ttyname_r.c index c7cf21aeee..d404245be5 100644 --- a/sysdeps/posix/ttyname_r.c +++ b/sysdeps/posix/ttyname_r.c @@ -43,7 +43,7 @@ __ttyname_r (fd, buf, buflen) dev_t mydev; ino_t myino; DIR *dirstream; - struct dirent dirbuf, *d; + struct dirent *d; int save = errno; /* Test for the absolute minimal size. This makes life easier inside @@ -74,7 +74,7 @@ __ttyname_r (fd, buf, buflen) buf[sizeof (dev) - 1] = '/'; buflen -= sizeof (dev); - while (__readdir_r (dirstream, &dirbuf, &d) >= 0) + while ((d = readdir (dirstream)) != NULL) if ((ino_t) d->d_fileno == myino) { char *cp; |