summaryrefslogtreecommitdiff
path: root/login/login.c
diff options
context:
space:
mode:
Diffstat (limited to 'login/login.c')
-rw-r--r--login/login.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/login/login.c b/login/login.c
index cf8632daab..075ef15056 100644
--- a/login/login.c
+++ b/login/login.c
@@ -43,7 +43,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;