changeset 819:6cc2a4cdc468

Ensure that child processes exit if the execlp call fails and returns control back to mlmmj-maint.
author Richard Mortimer
date Tue, 25 Jan 2011 15:21:40 +0000
parents 24bf028aa8a0
children ae97908485e9
files src/mlmmj-maintd.c
diffstat 1 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/mlmmj-maintd.c	Tue Jan 17 14:14:26 2012 +1100
+++ b/src/mlmmj-maintd.c	Tue Jan 25 15:21:40 2011 +0000
@@ -356,6 +356,10 @@
 						"-T", to,
 						"-a", (char *)NULL);
 			}
+			log_error(LOG_ARGS, "Could not execlp %s",
+						mlmmjsend);
+			/* This is the child. Exit on failure. */
+			exit(EXIT_FAILURE);
 		}
 	}
 
@@ -474,6 +478,10 @@
 					"-s", subnewname,
 					"-a",
 					"-D", (char *)NULL);
+			log_error(LOG_ARGS, "Could not execlp %s",
+						mlmmjsend);
+			/* This is the child. Exit on failure. */
+			exit(EXIT_FAILURE);
 		}
 	}
 
@@ -618,7 +626,8 @@
 					"-p", (char *)NULL);
 			log_error(LOG_ARGS, "Could not execlp %s",
 						mlmmjbounce);
-			return 1;
+			/* This is the child. Exit on failure. */
+			exit(EXIT_FAILURE);
 		}
 	}
 	closedir(bouncedir);
@@ -757,7 +766,8 @@
 					"-b", "-a", address, (char *)NULL);
 			log_error(LOG_ARGS, "Could not execlp %s",
 						mlmmjunsub);
-			return 1;
+			/* This is the child. Exit on failure. */
+			exit(EXIT_FAILURE);
 		}
 	}
 	closedir(bouncedir);