sigaction_many(&sa, SIGNALS_CRASH_HANDLER, -1);
}
-static int make_null_stdio(void) {
- int null_fd, r;
-
- if ((null_fd = open("/dev/null", O_RDWR|O_NOCTTY)) < 0) {
- log_error("Failed to open /dev/null: %m");
- return -errno;
- }
-
- if ((r = make_stdio(null_fd)) < 0)
- log_warning("Failed to dup2() device: %s", strerror(-r));
-
- return r;
-}
-
static int console_setup(bool do_reset) {
int tty_fd, r;
return 0;
}
+int make_null_stdio(void) {
+ int null_fd;
+
+ if ((null_fd = open("/dev/null", O_RDWR|O_NOCTTY)) < 0)
+ return -errno;
+
+ return make_stdio(null_fd);
+}
+
bool is_clean_exit(int code, int status) {
if (code == CLD_EXITED)
char *format_timespan(char *buf, size_t l, usec_t t);
int make_stdio(int fd);
+int make_null_stdio(void);
bool is_clean_exit(int code, int status);
bool is_clean_exit_lsb(int code, int status);