@cryptotaxi247 / netdata-1 / commits / f97ad1a66

remove all references to fatal() - cgroup-network now tries to continue

Costa Tsaousis (ktsaou) committed Jan 4, 2018 at 18:56 UTC f97ad1a66d18c0d9293017b72be3636b100df672
1 file changed +8 -5
src/cgroup-network.c
+8 -5
@@ -14,7 +14,6 @@
14 void netdata_cleanup_and_exit(int ret) {
15 exit(ret);
16 }
17 -
17 void health_reload(void) {};
18 void rrdhost_save_all(void) {};
19
@@ -367,8 +366,11 @@ void detect_veth_interfaces(pid_t pid) {
366 const char *prefix = getenv("NETDATA_HOST_PREFIX");
367
368 host = read_proc_net_dev(prefix);
370 - if(!host)
371 - fatal("cannot read host interface list.");
369 + if(!host) {
370 + errno = 0;
371 + error("cannot read host interface list.");
372 + return;
373 + }
374
375 if(!eligible_ifaces(host)) {
376 errno = 0;
@@ -487,7 +489,8 @@ int main(int argc, char **argv) {
489
490 if(pid <= 0) {
491 errno = 0;
490 - fatal("Invalid pid %d given", (int) pid);
492 + error("Invalid pid %d given", (int) pid);
493 + return 2;
494 }
495
496 call_the_helper(argv[0], pid, NULL);
@@ -498,7 +501,7 @@ int main(int argc, char **argv) {
501
502 if(pid <= 0 && !detected_devices) {
503 errno = 0;
501 - fatal("Invalid pid %d read from cgroup '%s'", (int) pid, argv[2]);
504 + error("Cannot find a cgroup PID from cgroup '%s'", argv[2]);
505 }
506 }
507 else