diff src/listen.c @ 262:fc1c6425c024

s/EXIT_SUCCESS/0/ && s/EXIT_FAILURE/1/ The constants are all to bulky. We should have different, meaningful exit codes anyway.
author markus schnalke <meillo@marmaro.de>
date Thu, 02 Dec 2010 17:11:25 -0300
parents dcb315792513
children 63efd381e27b
line wrap: on
line diff
--- a/src/listen.c	Thu Dec 02 16:52:39 2010 -0300
+++ b/src/listen.c	Thu Dec 02 17:11:25 2010 -0300
@@ -38,7 +38,7 @@
 
 	pid = waitpid(0, &status, 0);
 	if (pid > 0) {
-		if (WEXITSTATUS(status) != EXIT_SUCCESS)
+		if (WEXITSTATUS(status) != 0)
 			logwrite(LOG_WARNING, "process %d exited with %d\n", pid, WEXITSTATUS(status));
 		if (WIFSIGNALED(status))
 			logwrite(LOG_WARNING, "process with pid %d got signal: %d\n", pid, WTERMSIG(status));
@@ -79,7 +79,7 @@
 
 		smtp_in(in, out, rem_host, ident);
 
-		_exit(EXIT_SUCCESS);
+		_exit(0);
 	} else if (pid < 0) {
 		logwrite(LOG_WARNING, "could not fork for incoming smtp connection: %s\n", strerror(errno));
 	}
@@ -118,7 +118,7 @@
 		}
 		if (listen(sock, 1) < 0) {
 			logwrite(LOG_ALERT, "listen: (terminating): %s\n", strerror(errno));
-			exit(EXIT_FAILURE);
+			exit(1);
 		}
 		logwrite(LOG_NOTICE, "listening on interface %s:%d\n", iface->address, iface->port);
 		DEBUG(5) debugf("sock = %d\n", sock);
@@ -133,11 +133,11 @@
 	if (!conf.run_as_user) {
 		if (setegid(conf.mail_gid) != 0) {
 			logwrite(LOG_ALERT, "could not change gid to %d: %s\n", conf.mail_gid, strerror(errno));
-			exit(EXIT_FAILURE);
+			exit(1);
 		}
 		if (seteuid(conf.mail_uid) != 0) {
 			logwrite(LOG_ALERT, "could not change uid to %d: %s\n", conf.mail_uid, strerror(errno));
-			exit(EXIT_FAILURE);
+			exit(1);
 		}
 	}
 
@@ -173,7 +173,7 @@
 		if ((sel_ret = select(FD_SETSIZE, &read_fd_set, NULL, NULL, qival > 0 ? &tm : NULL)) < 0) {
 			if (errno != EINTR) {
 				logwrite(LOG_ALERT, "select: (terminating): %s\n", strerror(errno));
-				exit(EXIT_FAILURE);
+				exit(1);
 			} else {
 				if (sighup_seen) {
 					logwrite(LOG_NOTICE, "HUP signal received. Restarting daemon\n");
@@ -184,7 +184,7 @@
 
 					execv(argv[0], &(argv[0]));
 					logwrite(LOG_ALERT, "restarting failed: %s\n", strerror(errno));
-					exit(EXIT_FAILURE);
+					exit(1);
 				}
 			}
 		} else if (sel_ret > 0) {
@@ -208,7 +208,7 @@
 			if ((pid = fork()) == 0) {
 				queue_run();
 
-				_exit(EXIT_SUCCESS);
+				_exit(0);
 			} else if (pid < 0) {
 				logwrite(LOG_ALERT, "could not fork for queue run");
 			}