From 9e57f24771fc66b5aa1d5afb0893047dcaa53edc Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 11 Mar 2011 14:25:45 +0100 Subject: [PATCH] tailf: fix open() return value check [coverity scan] Signed-off-by: Karel Zak --- text-utils/tailf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/text-utils/tailf.c b/text-utils/tailf.c index 51529dba62..0b99a1ae69 100644 --- a/text-utils/tailf.c +++ b/text-utils/tailf.c @@ -93,7 +93,8 @@ roll_file(const char *filename, off_t *size) struct stat st; off_t pos; - if (!(fd = open(filename, O_RDONLY))) + fd = open(filename, O_RDONLY); + if (fd < 0) err(EXIT_FAILURE, _("cannot open \"%s\" for read"), filename); if (fstat(fd, &st) == -1) -- 2.47.3