core: kill nm_spawn_process()

It's not used anymore. Which is a good thing, because if it was used
we'd have to get rid of the uses.

It did accept a whitespace separated string for an argument, which is
never useful for us; it indicated error either on g_spawn_sync()
failure or an error status code of the program spawned, but only set the
error in the former case which had let to errors.

The would would be a bit nicer place without it.
(But not much)
This commit is contained in:
Lubomir Rintel 2017-02-03 18:20:44 +01:00
parent 55a5bf580d
commit 6404c79e4d
2 changed files with 0 additions and 26 deletions

View file

@ -367,30 +367,6 @@ nm_utils_array_remove_at_indexes (GArray *array, const guint *indexes_to_delete,
g_array_set_size (array, res_length);
}
int
nm_spawn_process (const char *args, GError **error)
{
GError *local = NULL;
gint num_args;
char **argv = NULL;
int status = -1;
g_return_val_if_fail (args != NULL, -1);
g_return_val_if_fail (!error || !*error, -1);
if (g_shell_parse_argv (args, &num_args, &argv, &local)) {
g_spawn_sync ("/", argv, NULL, 0, NULL, NULL, NULL, NULL, &status, &local);
g_strfreev (argv);
}
if (local) {
nm_log_warn (LOGD_CORE, "could not spawn process '%s': %s", args, local->message);
g_propagate_error (error, local);
}
return status;
}
static const char *
_trunk_first_line (char *str)
{

View file

@ -112,8 +112,6 @@ nm_utils_ip6_route_metric_normalize (guint32 metric)
return metric ? metric : 1024 /*NM_PLATFORM_ROUTE_METRIC_DEFAULT_IP6*/;
}
int nm_spawn_process (const char *args, GError **error);
int nm_utils_modprobe (GError **error, gboolean suppress_error_loggin, const char *arg1, ...) G_GNUC_NULL_TERMINATED;
guint64 nm_utils_get_start_time_for_pid (pid_t pid, char *out_state, pid_t *out_ppid);