From 42646a8bf24be2c9280554c9d8540c67c835b3c4 Mon Sep 17 00:00:00 2001
From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Date: Tue, 16 Sep 2014 22:58:35 +0200
Subject: [PATCH] util: remove a unnecessary check
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 | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/shared/util.c b/src/shared/util.c
index 61d6680ddd..30b0364b64 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -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);