diff options
Diffstat (limited to 'src/getty-generator/getty-generator.c')
-rw-r--r-- | src/getty-generator/getty-generator.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/getty-generator/getty-generator.c b/src/getty-generator/getty-generator.c index 7486118..acce71b 100644 --- a/src/getty-generator/getty-generator.c +++ b/src/getty-generator/getty-generator.c @@ -94,9 +94,8 @@ static int verify_tty(const char *name) { if (fd < 0) return -errno; - errno = 0; - if (isatty(fd) <= 0) - return errno_or_else(EIO); + if (!isatty_safe(fd)) + return -errno; return 0; } @@ -151,7 +150,7 @@ static int add_credential_gettys(void) { }; int r; - FOREACH_ARRAY(t, table, ELEMENTSOF(table)) { + FOREACH_ELEMENT(t, table) { _cleanup_free_ char *b = NULL; size_t sz = 0; |