projects
/
project
/
procd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
trivial code cleanup
[project/procd.git]
/
debug.c
diff --git
a/debug.c
b/debug.c
index
7d7798b
..
fbf1e4f
100644
(file)
--- a/
debug.c
+++ b/
debug.c
@@
-29,14
+29,14
@@
void debug_init(void)
regex_t pat_cmdline;
regmatch_t matches[2];
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);
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]);
if (!regexec(&pat_cmdline, line, 2, matches, 0)) {
line[matches[1].rm_eo] = '\0';
debug = atoi(&line[matches[1].rm_so]);