tailf: fix open() return value check [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2011-03-11 14:25:45 +01:00
parent c0f6d6d0c4
commit 9e57f24771
1 changed files with 2 additions and 1 deletions

View 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)