From 22f4096ca96acd504ac74e7dfad96f07edb6da51 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 31 Aug 2010 21:05:54 +0200 Subject: systemctl: rework exit codes for all utility programs to follow LSB or other standards --- src/logger.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/logger.c') diff --git a/src/logger.c b/src/logger.c index 5a28c2197f..a590bb84fd 100644 --- a/src/logger.c +++ b/src/logger.c @@ -557,16 +557,16 @@ static int process_event(Server *s, struct epoll_event *ev) { int main(int argc, char *argv[]) { Server server; - int r = 3, n; + int r = EXIT_FAILURE, n; if (getppid() != 1) { log_error("This program should be invoked by init only."); - return 1; + return EXIT_FAILURE; } if (argc > 1) { log_error("This program does not take arguments."); - return 1; + return EXIT_FAILURE; } log_set_target(LOG_TARGET_SYSLOG_OR_KMSG); @@ -575,16 +575,16 @@ int main(int argc, char *argv[]) { if ((n = sd_listen_fds(true)) < 0) { log_error("Failed to read listening file descriptors from environment: %s", strerror(-r)); - return 1; + return EXIT_FAILURE; } if (n <= 0 || n > SERVER_FD_MAX) { log_error("No or too many file descriptors passed."); - return 2; + return EXIT_FAILURE; } if (server_init(&server, (unsigned) n) < 0) - return 3; + return EXIT_FAILURE; log_debug("systemd-logger running as pid %lu", (unsigned long) getpid()); @@ -614,7 +614,7 @@ int main(int argc, char *argv[]) { goto fail; } - r = 0; + r = EXIT_SUCCESS; log_debug("systemd-logger stopped as pid %lu", (unsigned long) getpid()); -- cgit v1.2.3-54-g00ecf