Skip to content
Snippets Groups Projects
Commit 22582fa3 authored by Christopher J. Morrone's avatar Christopher J. Morrone
Browse files
parent 5ae4fd2a
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,7 @@
#include <slurm/slurm_errno.h>
#include "src/common/log.h"
#include "src/common/fd.h"
#include "src/common/macros.h"
#include "src/common/safeopen.h"
#include "src/common/xassert.h"
......@@ -239,8 +240,13 @@ _log_init(char *prog, log_options_t opt, log_facility_t fac, char *logfile )
log->logfp = fp;
}
if (log->logfp && (fileno(log->logfp) < 0))
log->logfp = NULL;
if (log->logfp) {
int fd;
if ((fd = fileno(log->logfp)) < 0)
log->logfp = NULL;
else
fd_set_close_on_exec(fd);
}
log->initialized = 1;
out:
......
......@@ -361,14 +361,13 @@ exec_task(slurmd_job_t *job, int i, int waitfd)
job->env[0] = (char *)NULL;
}
log_fini();
execve(task->argv[0], task->argv, job->env);
/*
* print error message and clean up if execve() returns:
*/
fprintf(stderr, "Unable to run executable \"%s\"\n", task->argv[0]);
exit(42);
error("execve(): %s: %m", task->argv[0]);
exit(errno);
}
static void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment