From cac289316bed4282f798dbe710398e6f53f66f1f Mon Sep 17 00:00:00 2001 From: Thomas Huehn Date: Fri, 5 Jul 2013 12:04:14 +0200 Subject: 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 --- debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debug.c') 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); -- cgit v1.2.3