@cryptotaxi247 / netdata-1 / commits / 2d64790f8

Abort on non-zero rc. (#17008)

vkalintiris committed Feb 14, 2024 at 13:10 UTC 2d64790f8c6c8be091ae6a68a64ba7176096681a
1 file changed +10 -4
src/daemon/main.c
+10 -4
@@ -511,13 +511,19 @@ void netdata_cleanup_and_exit(int ret, const char *action, const char *action_re
511
512 delta_shutdown_time("exit");
513
514 -#ifdef ENABLE_SENTRY
515 - sentry_native_fini();
516 -#endif
517 -
514 usec_t ended_ut = now_monotonic_usec();
515 netdata_log_info("NETDATA SHUTDOWN: completed in %llu ms - netdata is now exiting - bye bye...", (ended_ut - started_ut) / USEC_PER_MS);
516 +
517 +#ifdef ENABLE_SENTRY
518 + if (ret)
519 + abort();
520 + else {
521 + sentry_native_fini();
522 + exit(ret);
523 + }
524 +#else
525 exit(ret);
526 +#endif
527 }
528
529 void web_server_threading_selection(void) {