summaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
authorThomas Huehn <thomas@net.t-labs.tu-berlin.de>2013-07-05 12:04:14 +0200
committerJohn Crispin <blogic@openwrt.org>2013-07-08 11:00:36 +0200
commitcac289316bed4282f798dbe710398e6f53f66f1f (patch)
tree642f58f05da8db7634f0e6c09f08b7e6d454e174 /debug.c
parent3283d681f9da65b500ad0cb3d4550cb840ed481a (diff)
downloadunitd-cac289316bed4282f798dbe710398e6f53f66f1f.tar
unitd-cac289316bed4282f798dbe710398e6f53f66f1f.zip
bugfix of error handling while open()
The normal return value from open() is a non-negative integer. In the case of an error, a value of -1 is returned instead. Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/debug.c b/debug.c
index 7d7798b..91e874f 100644
--- a/debug.c
+++ b/debug.c
@@ -29,7 +29,7 @@ void debug_init(void)
regex_t pat_cmdline;
regmatch_t matches[2];
- if (!fd)
+ if (fd < 0)
return;
r = read(fd, line, sizeof(line) - 1);