artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
72ee816
)
If ~/.magic exists but can't be used, fail rather than silently falling
author
nicm
<nicm@openbsd.org>
Fri, 24 Apr 2015 16:28:00 +0000
(16:28 +0000)
committer
nicm
<nicm@openbsd.org>
Fri, 24 Apr 2015 16:28:00 +0000
(16:28 +0000)
back to /etc/magic.
usr.bin/file/file.c
patch
|
blob
|
history
diff --git
a/usr.bin/file/file.c
b/usr.bin/file/file.c
index
d83a1f4
..
8165f61
100644
(file)
--- a/
usr.bin/file/file.c
+++ b/
usr.bin/file/file.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: file.c,v 1.2
7 2015/04/24 16:24:11
nicm Exp $ */
+/* $OpenBSD: file.c,v 1.2
8 2015/04/24 16:28:00
nicm Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
@@
-154,6
+154,10
@@
main(int argc, char **argv)
if (home != NULL) {
xasprintf(&path, "%s/.magic", home);
f = fopen(path, "r");
+ if (f == NULL && errno != ENOENT)
+ err(1, "%s", path);
+ if (f == NULL)
+ free(path);
} else
f = NULL;
if (f == NULL) {