From: Thomas Hindoe Paaboel Andersen Date: Tue, 16 Sep 2014 20:58:35 +0000 (+0200) Subject: util: remove a unnecessary check X-Git-Tag: v217~547 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=42646a8bf24be2c9280554c9d8540c67c835b3c4 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 --- diff --git a/src/shared/util.c b/src/shared/util.c index 61d6680dd..30b0364b6 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);