From b0bde9f33d4675f125919b31542c5885e70aaa96 Mon Sep 17 00:00:00 2001 From: "F. Aragon" Date: Thu, 20 Sep 2018 16:42:31 +0200 Subject: [PATCH] tools: return check (Coverity 1399196) Signed-off-by: F. Aragon --- tools/start-stop-daemon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/start-stop-daemon.c b/tools/start-stop-daemon.c index cc0315c130..8daeda7402 100644 --- a/tools/start-stop-daemon.c +++ b/tools/start-stop-daemon.c @@ -1030,7 +1030,9 @@ int main(int argc, char **argv) /* change tty */ fd = open("/dev/tty", O_RDWR); if (fd >= 0) { - ioctl(fd, TIOCNOTTY, 0); + if (ioctl(fd, TIOCNOTTY, 0) < 0) + printf("ioctl TIOCNOTTY failed: %s\n", + strerror(errno)); close(fd); } chdir("/"); -- 2.39.5