diff options
| author | Andre Albsmeier <mail@fbsd2.e4m.org> | 2024-08-19 07:54:24 +0000 |
|---|---|---|
| committer | Konstantin Belousov <kib@FreeBSD.org> | 2024-08-19 07:54:24 +0000 |
| commit | 308399a179a49b7b858c725de10177fdb0502fd2 (patch) | |
| tree | 2f2c81ec841b4306d9ccf9ce1bc4383da3824fea /usr.bin/tail | |
| parent | 8132e959099f0c533f698d8fbc17386f9144432f (diff) | |
Diffstat (limited to 'usr.bin/tail')
| -rw-r--r-- | usr.bin/tail/forward.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index a5303385a74f..6d9db94a827f 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -379,7 +379,8 @@ follow(file_info_t *files, enum STYLE style, off_t off) sb2.st_dev != file->st.st_dev || sb2.st_nlink == 0) { show(file); - fclose(file->fp); + if (file->fp != NULL) + fclose(file->fp); file->fp = ftmp; memcpy(&file->st, &sb2, sizeof(struct stat)); |
