From: Richard Mortimer Date: Tue, 25 Jan 2011 15:21:40 +0000 (+0000) Subject: Ensure that child processes exit if the execlp call fails and returns X-Git-Tag: RELEASE_1_2_18a1~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d12ddc27ebf4e3f3fd226eb085ae7433cfc40ec;p=thirdparty%2Fmlmmj.git Ensure that child processes exit if the execlp call fails and returns control back to mlmmj-maint. --- diff --git a/src/mlmmj-maintd.c b/src/mlmmj-maintd.c index afe5c688..422d630b 100644 --- a/src/mlmmj-maintd.c +++ b/src/mlmmj-maintd.c @@ -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);