git.asbjorn.biz
/
debian
/
dhcpd-pools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
a31fd0d
)
parse_leases: exit at read error
upstream-head
author
Sami Kerola
<sami.kerola@tomtom.com>
Thu, 23 Jun 2011 13:59:06 +0000
(15:59 +0200)
committer
Sami Kerola
<sami.kerola@tomtom.com>
Thu, 23 Jun 2011 13:59:06 +0000
(15:59 +0200)
Signed-off-by: Sami Kerola <sami.kerola@tomtom.com>
src/getdata.c
patch
|
blob
|
history
diff --git
a/src/getdata.c
b/src/getdata.c
index
2c5e627
..
b0a3f5c
100644
(file)
--- a/
src/getdata.c
+++ b/
src/getdata.c
@@
-130,7
+130,9
@@
int parse_leases(void)
}
while (!feof(dhcpd_leases)) {
- fgets(line, MAXLEN, dhcpd_leases);
+ if (!fgets(line, MAXLEN, dhcpd_leases) && ferror(dhcpd_leases)) {
+ err(EXIT_FAILURE, "parse_leases: %s", config.dhcpdlease_file);
+ }
/* It's a lease, save IP */
if (strstr(line, "lease") == line) {
strncpy(ipstring, line, (size_t) MAXLEN);