chiark / gitweb /
terminal-util: remove unnecessary check of result of isatty() (#4000)
[elogind.git] / src / basic / terminal-util.c
index 215b764882b95dbde54dc09b599b0a948776de1f..efd35cd727cc944c166f428c113669ff97d975c6 100644 (file)
@@ -347,12 +347,7 @@ int open_terminal(const char *name, int mode) {
         }
 
         r = isatty(fd);
-        if (r < 0) {
-                safe_close(fd);
-                return -errno;
-        }
-
-        if (!r) {
+        if (r == 0) {
                 safe_close(fd);
                 return -ENOTTY;
         }