]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tailf: fix open() return value check [coverity scan]
authorKarel Zak <kzak@redhat.com>
Fri, 11 Mar 2011 13:25:45 +0000 (14:25 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 11 Mar 2011 13:25:45 +0000 (14:25 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
text-utils/tailf.c

index 51529dba62329bc12064e835c4786ed061d1b53d..0b99a1ae69d0f2b6ba733fc316751f0d5c9b58bf 100644 (file)
@@ -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)