diff options
Diffstat (limited to 'login')
-rw-r--r-- | login/login.c | 6 | ||||
-rw-r--r-- | login/pty.h | 3 |
2 files changed, 6 insertions, 3 deletions
diff --git a/login/login.c b/login/login.c index 7cbe8b603e..0df11c6895 100644 --- a/login/login.c +++ b/login/login.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -42,7 +42,7 @@ tty_name (int fd, char **tty, size_t buf_len) { rv = ttyname_r (fd, buf, buf_len); - if (rv < 0 || memchr (buf, '\0', buf_len)) + if (rv != 0 || memchr (buf, '\0', buf_len)) /* We either got an error, or we succeeded and the returned name fit in the buffer. */ break; @@ -65,6 +65,8 @@ tty_name (int fd, char **tty, size_t buf_len) __set_errno (ENOMEM); break; } + + buf = new_buf; } if (rv == 0) diff --git a/login/pty.h b/login/pty.h index 09024a787a..731ab12d82 100644 --- a/login/pty.h +++ b/login/pty.h @@ -1,5 +1,5 @@ /* pty.h - Functions for pseudo TTY handling. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 1997 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -22,6 +22,7 @@ #define _PTY_H 1 #include <features.h> +#include <ioctl-types.h> #include <termios.h> |