Skip to content
Snippets Groups Projects
Commit d26c3581 authored by Moe Jette's avatar Moe Jette
Browse files

minor tweaks for clean build on OSX.

Minimally tested.
parent 7a2a6212
No related branches found
No related tags found
No related merge requests found
......@@ -84,9 +84,11 @@ BEGIN_C_DECLS
#if HAVE_INTTYPES_H
# include <inttypes.h> /* for uint16_t, uint32_t definitions */
#endif
#include <stdbool.h>
#include <stdio.h> /* for FILE definitions */
#include <sys/types.h> /* for uid_t definition */
#include <time.h> /* for time_t definitions */
#include <stdbool.h>
#include <unistd.h>
#ifdef CRAPPY_COMPILER
/*
......
......@@ -897,7 +897,11 @@ static void _trigger_run_program(trig_mgr_info_t *trig_in)
int i;
for (i=0; i<128; i++)
close(i);
#ifdef SETPGRP_TWO_ARGS
setpgrp(0, 0);
#else
setpgrp();
#endif
setsid();
setuid(uid);
setgid(gid);
......
......@@ -1736,7 +1736,11 @@ _run_script_as_user(const char *name, const char *path, slurmd_job_t *job,
}
chdir(job->cwd);
#ifdef SETPGRP_TWO_ARGS
setpgrp(0, 0);
#else
setpgrp();
#endif
execve(path, argv, env);
error("execve(): %m");
exit(127);
......
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