diff options
| author | Xin LI <delphij@FreeBSD.org> | 2016-11-07 07:26:06 +0000 |
|---|---|---|
| committer | Xin LI <delphij@FreeBSD.org> | 2016-11-07 07:26:06 +0000 |
| commit | 46a30e2e108c3996f8c1ef41888011c2a5cedaf7 (patch) | |
| tree | d5b3320c0abb93ce4b48892c8cf3704e4a3ed009 /src/file.c | |
| parent | 581c312f134935d421daea8ff9efe57e66a2beab (diff) | |
Diffstat (limited to 'src/file.c')
| -rw-r--r-- | src/file.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/file.c b/src/file.c index 9a8606d5418f..fad3160d15fe 100644 --- a/src/file.c +++ b/src/file.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: file.c,v 1.171 2016/05/17 15:52:45 christos Exp $") +FILE_RCSID("@(#)$File: file.c,v 1.172 2016/10/24 15:21:07 christos Exp $") #endif /* lint */ #include "magic.h" @@ -431,6 +431,8 @@ private struct magic_set * load(const char *magicfile, int flags) { struct magic_set *magic = magic_open(flags); + const char *e; + if (magic == NULL) { (void)fprintf(stderr, "%s: %s\n", progname, strerror(errno)); return NULL; @@ -441,6 +443,8 @@ load(const char *magicfile, int flags) magic_close(magic); return NULL; } + if ((e = magic_error(magic)) != NULL) + (void)fprintf(stderr, "%s: Warning: %s\n", progname, e); return magic; } |
