X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;ds=sidebyside;f=debug.c;h=fbf1e4fb1b51def0ff0f065f165acdac2e0ae8ef;hb=ed0464dbda4125cc857d8a06b84fa695d0b29251;hp=7d7798b9be6c5910c1e9a446e5c2472cc340e9c9;hpb=13e442a84766b111b50651bab6f97ad6f951148a;p=project%2Fprocd.git diff --git a/debug.c b/debug.c index 7d7798b..fbf1e4f 100644 --- a/debug.c +++ b/debug.c @@ -29,14 +29,14 @@ 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); line[r] = '\0'; close(fd); - regcomp(&pat_cmdline, "init_debug=([0-9]*)", REG_EXTENDED); + regcomp(&pat_cmdline, "init_debug=([0-9]+)", REG_EXTENDED); if (!regexec(&pat_cmdline, line, 2, matches, 0)) { line[matches[1].rm_eo] = '\0'; debug = atoi(&line[matches[1].rm_so]);