Change-Id: I57e45894ffb4e4e32e4560f8a15adc54335067d0
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
pid_t pid;
int rpipe[2];
struct pollfd pfd;
pid_t pid;
int rpipe[2];
struct pollfd pfd;
/* instanciate the arguments */
params->readyfd = rpipe[1];
args = instantiate_arguments(exec->args, desc, params, 1).vector;
/* instanciate the arguments */
params->readyfd = rpipe[1];
args = instantiate_arguments(exec->args, desc, params, 1).vector;
+ env = instantiate_arguments((const char * const*)environ,
+ desc, params, 1).vector;
+ if (args == NULL || env == NULL) {
close(rpipe[0]);
close(rpipe[1]);
close(rpipe[0]);
close(rpipe[1]);
+ free(args);
+ free(env);
ERROR("out of memory in master");
errno = ENOMEM;
return -1;
ERROR("out of memory in master");
errno = ENOMEM;
return -1;
close(rpipe[0]);
close(rpipe[1]);
free(args);
close(rpipe[0]);
close(rpipe[1]);
free(args);
ERROR("master fork failed: %m");
return -1;
}
ERROR("master fork failed: %m");
return -1;
}
close(rpipe[1]);
free(args);
close(rpipe[1]);
free(args);
pfd.fd = rpipe[0];
pfd.events = POLLIN;
pfd.fd = rpipe[0];
pfd.events = POLLIN;
}
/* executes the process */
}
/* executes the process */
- rc = execve(args[0], args, environ);
+ rc = execve(args[0], args, env);
ERROR("failed to exec master %s: %m", args[0]);
_exit(1);
return -1;
ERROR("failed to exec master %s: %m", args[0]);
_exit(1);
return -1;
else
groupid = (gid_t)-1;
else
groupid = (gid_t)-1;
+ /* reads the configuration file */
rc = read_configuration_file(FWK_LAUNCH_CONF);
/* dump_launchers(stderr); */
rc = read_configuration_file(FWK_LAUNCH_CONF);
/* dump_launchers(stderr); */