mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-09-06 17:14:02 +00:00
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:
parent
55a5bf580d
commit
6404c79e4d
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue