chiark / gitweb /
util: remove a unnecessary check
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Tue, 16 Sep 2014 20:58:35 +0000 (22:58 +0200)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Tue, 16 Sep 2014 21:03:50 +0000 (23:03 +0200)
We only break out of the previous loop if fd >= 0 so there is no
use in checking it again.

Found by coverity. Fixes: CID#1237577

src/shared/util.c

index 61d6680..30b0364 100644 (file)
@@ -1878,9 +1878,6 @@ int open_terminal(const char *name, int mode) {
                 c++;
         }
 
-        if (fd < 0)
-                return -errno;
-
         r = isatty(fd);
         if (r < 0) {
                 safe_close(fd);