projects
/
dragonfly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
6513a1b
)
HAMMER - Check if supplied conf file exists
author
Stathis Kamperis <beket@dragonflybsd.org>
Sat, 13 Nov 2010 16:40:48 +0000 (18:40 +0200)
committer
Stathis Kamperis <beket@dragonflybsd.org>
Sat, 13 Nov 2010 16:40:51 +0000 (18:40 +0200)
Dragonfly-bug: <http://bugs.dragonflybsd.org/issue1911>
sbin/hammer/cmd_config.c
patch
|
blob
|
blame
|
history
diff --git
a/sbin/hammer/cmd_config.c
b/sbin/hammer/cmd_config.c
index
5e68e60
..
fe5c87c
100644
(file)
--- a/
sbin/hammer/cmd_config.c
+++ b/
sbin/hammer/cmd_config.c
@@
-87,6
+87,10
@@
hammer_cmd_config(char **av, int ac)
config.head.error = 0;
fd = open(av[1], O_RDONLY);
+ if (fd < 0) {
+ err(2, "hammer config: %s", av[1]);
+ /* not reached */
+ }
n = read(fd, config.config.text, sizeof(config.config.text) - 1);
if (n == sizeof(config.config.text) - 1) {
err(2, "hammer config: config file too big, limit %zu bytes",