summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tail/forward.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c
index 6ed5691..e1e0638 100644
--- a/usr.bin/tail/forward.c
+++ b/usr.bin/tail/forward.c
@@ -361,8 +361,10 @@ follow(file_info_t *files, enum STYLE style, off_t off)
if (errno != ENOENT)
ierr(file->file_name);
show(file);
- fclose(file->fp);
- file->fp = NULL;
+ if (file->fp != NULL) {
+ fclose(file->fp);
+ file->fp = NULL;
+ }
ev_change++;
continue;
}
OpenPOWER on IntegriCloud