From 399936c7a7cc1a22fa901cc8882d8658e1614de3 Mon Sep 17 00:00:00 2001 From: thib Date: Tue, 5 Sep 2000 19:55:57 +0000 Subject: [PATCH] try execlp in case of a execl fail. --- job.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/job.c b/job.c index 3ac42dc..66130c2 100644 --- a/job.c +++ b/job.c @@ -22,7 +22,7 @@ * `LICENSE' that comes with the fcron source distribution. */ - /* $Id: job.c,v 1.21 2000-09-04 13:09:31 thib Exp $ */ + /* $Id: job.c,v 1.22 2000-09-05 19:55:57 thib Exp $ */ #include "fcron.h" @@ -188,8 +188,9 @@ run_job(CL *line) #endif /* CHECKJOBS */ execl(shell, shell, "-c", line->cl_shell, NULL); - /* execl returns only on error */ + error_e("Can't find '%s'. Trying a execlp(\"sh\", ...)", shell); + execlp("sh", "sh", "-c", line->cl_shell, NULL); die_e("execl() '%s -c %s' error", shell, line->cl_shell); /* execution never gets here */ @@ -280,7 +281,7 @@ launch_mailer(CL *line, int mailfd) /* run sendmail with mail file as standard input */ execl(SENDMAIL, SENDMAIL, SENDMAIL_ARGS, pass->pw_name, NULL); - error_e("Can't find sendmail. Trying a execlp(\"sendmail\")"); + error_e("Can't find '"SENDMAIL"'. Trying a execlp(\"sendmail\")"); execlp("sendmail", "sendmail", SENDMAIL_ARGS, pass->pw_name, NULL); die_e("Can't exec " SENDMAIL); -- 2.40.0