projects
/
icmpmonitor
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0293069
)
Tracking return value of system().
master
origin/HEAD
origin/master
author
Aaron Taylor
<ataylor@subgeniuskitty.com>
Mon, 7 Oct 2019 12:19:02 +0000
(
05:19
-0700)
committer
Aaron Taylor
<ataylor@subgeniuskitty.com>
Mon, 7 Oct 2019 12:19:02 +0000
(
05:19
-0700)
icmpmonitor.c
patch
|
blob
|
blame
|
history
diff --git
a/icmpmonitor.c
b/icmpmonitor.c
index
5dd5064
..
76404c2
100644
(file)
--- a/
icmpmonitor.c
+++ b/
icmpmonitor.c
@@
-133,8
+133,8
@@
pinger(int ignore) /* Dummy parameter since this function registers as a signal
if (verbose) printf("INFO: Host %s stopped responding. Executing DOWN command.\n", host->name);
host->host_up = false;
if (!fork()) {
if (verbose) printf("INFO: Host %s stopped responding. Executing DOWN command.\n", host->name);
host->host_up = false;
if (!fork()) {
- system(host->down_cmd);
- exit(
EXIT_SUCCESS
);
+
int sys_ret =
system(host->down_cmd);
+ exit(
sys_ret
);
}
}
}
}
@@
-201,8
+201,8
@@
read_icmp_data(struct host_entry * host)
if (verbose) printf("INFO: Host %s started responding. Executing UP command.\n", host->name);
host->host_up = true;
if (!fork()) {
if (verbose) printf("INFO: Host %s started responding. Executing UP command.\n", host->name);
host->host_up = true;
if (!fork()) {
- system(host->up_cmd);
- exit(
EXIT_SUCCESS
);
+
int sys_ret =
system(host->up_cmd);
+ exit(
sys_ret
);
}
}
} else {
}
}
} else {