utmpdump: check ftello() return value

Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2019-05-16 13:46:03 +02:00
parent 4ac2ab97d1
commit e868cfb0a6
1 changed files with 3 additions and 0 deletions

View File

@ -169,6 +169,9 @@ static int follow_by_inotify(FILE *in, const char *filename, FILE *out)
size = ftello(in);
fclose(in);
if (size < 0)
err(EXIT_FAILURE, _("%s: cannot get file position"), filename);
wd = inotify_add_watch(fd, filename, EVENTS);
if (wd == -1)
err(EXIT_FAILURE, _("%s: cannot add inotify watch."), filename);