]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
Ensure that child processes exit if the execlp call fails and returns
authorRichard Mortimer <none@none>
Tue, 25 Jan 2011 15:21:40 +0000 (15:21 +0000)
committerRichard Mortimer <none@none>
Tue, 25 Jan 2011 15:21:40 +0000 (15:21 +0000)
control back to mlmmj-maint.

src/mlmmj-maintd.c

index afe5c68877e0fd19f7c402f0b8cba7a941af90e5..422d630b6b3211dd3f74f57a5665fb2457a94c3a 100644 (file)
@@ -356,6 +356,10 @@ int resend_queue(const char *listdir, const char *mlmmjsend)
                                                "-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 @@ int resend_requeue(const char *listdir, const char *mlmmjsend)
                                        "-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 @@ int probe_bouncers(const char *listdir, const char *mlmmjbounce)
                                        "-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 @@ int unsub_bouncers(const char *listdir, const char *mlmmjunsub)
                                        "-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);