return TRUE;
}
-static void
-child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process at this point */
- /* Give child a different process group to ensure signal separation. */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-}
-
#define SCRIPT_TIMEOUT 600 /* 10 minutes */
static void
if (request->debug)
g_message ("Running script '%s'", script->script);
- if (g_spawn_async ("/", argv, request->envp, G_SPAWN_DO_NOT_REAP_CHILD, child_setup, request, &script->pid, &error)) {
+ if (g_spawn_async ("/", argv, request->envp, G_SPAWN_DO_NOT_REAP_CHILD, NULL, request, &script->pid, &error)) {
request->script_watch_id = g_child_watch_add (script->pid, (GChildWatchFunc) script_watch_cb, script);
request->script_timeout_id = g_timeout_add_seconds (SCRIPT_TIMEOUT, script_timeout_cb, script);
} else {
"Activation: Stage 4 of 5 (IPv6 Configure Timeout) scheduled...");
}
-static void
-share_child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process at this point */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-}
-
static gboolean
share_init (void)
{
GError *error = NULL;
if (!g_spawn_sync ("/", argv, envp, G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
- share_child_setup, NULL, NULL, NULL, &status, &error)) {
+ NULL, NULL, NULL, NULL, &status, &error)) {
nm_log_err (LOGD_SHARING, "share: error loading NAT module %s: (%d) %s",
*iter, error ? error->code : 0,
(error && error->message) ? error->message : "unknown");
/**********************************/
/* SUSE */
-static void
-netconfig_child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- pid_t pid = getpid ();
- setpgid (pid, pid);
-}
-
static GPid
run_netconfig (GError **error, gint *stdin_fd)
{
nm_log_dbg (LOGD_DNS, "spawning '%s'", tmp);
g_free (tmp);
- if (!g_spawn_async_with_pipes (NULL, argv, NULL, 0, netconfig_child_setup,
+ if (!g_spawn_async_with_pipes (NULL, argv, NULL, 0, NULL,
NULL, &pid, stdin_fd, NULL, NULL, error))
return -1;
priv->share_rules = NULL;
}
-static void
-share_child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process at this point */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-}
-
void
nm_act_request_set_shared (NMActRequest *req, gboolean shared)
{
nm_log_info (LOGD_SHARING, "Executing: %s", cmd);
if (!g_spawn_sync ("/", argv, envp, G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL,
- share_child_setup, NULL, NULL, NULL, &status, &error)) {
+ NULL, NULL, NULL, NULL, &status, &error)) {
nm_log_warn (LOGD_SHARING, "Error executing command: (%d) %s",
error ? error->code : -1,
(error && error->message) ? error->message : "(unknown)");
#define PARSE_WARNING(msg...) nm_log_warn (LOGD_SETTINGS, " " msg)
-static void
-iscsiadm_child_setup (gpointer user_data G_GNUC_UNUSED)
-{
- /* We are in the child process here; set a different process group to
- * ensure signal isolation between child and parent.
- */
- pid_t pid = getpid ();
- setpgid (pid, pid);
-}
-
/* Removes trailing whitespace and whitespace before and immediately after the '=' */
static char *
remove_most_whitespace (const char *src)
g_return_val_if_fail (out_blocks != NULL && *out_blocks == NULL, FALSE);
if (!g_spawn_sync ("/", (char **) argv, (char **) envp, 0,
- iscsiadm_child_setup, NULL, &out, &err, &status, error))
+ NULL, NULL, &out, &err, &status, error))
goto done;
if (!WIFEXITED (status)) {