aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/tail/forward.c
diff options
context:
space:
mode:
authorJilles Tjoelker <jilles@FreeBSD.org>2011-08-14 13:37:38 +0000
committerJilles Tjoelker <jilles@FreeBSD.org>2011-08-14 13:37:38 +0000
commit54d34ff63deb6b929444de83db4c9fa96e7ba6e5 (patch)
tree22b6d2a5e4c8f8391e3a145ad422b9b837a4901b /usr.bin/tail/forward.c
parenta3427d6a49ac4e6f57a50304d5ac651c48f95b21 (diff)
Notes
Diffstat (limited to 'usr.bin/tail/forward.c')
-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 6ed5691c366f..e1e0638d7ad3 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;
}