diff options
| author | Michael Biebl <biebl@debian.org> | 2022-02-14 19:23:28 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2022-02-14 19:23:28 +0100 |
| commit | 2f94dba7385fd0e0ef19a06eb4a2fcf6c43d7946 (patch) | |
| tree | e2222f5577115985dd52044d2991253403cdd952 /src/core/main-utils.c | |
| parent | 88c227d90a6b7b388c5c85d72802a0ca8f05ed5c (diff) | |
New upstream version 1.35.91 upstream/1.35.91
Diffstat (limited to 'src/core/main-utils.c')
| -rw-r--r-- | src/core/main-utils.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/src/core/main-utils.c b/src/core/main-utils.c index 48f143c3..444e122e 100644 --- a/src/core/main-utils.c +++ b/src/core/main-utils.c @@ -172,8 +172,8 @@ nm_main_utils_ensure_not_running_pidfile(const char *pidfile) gs_free char *proc_cmdline = NULL; gsize len = 0; long pid; - const char * process_name; - const char * prgname = g_get_prgname(); + const char *process_name; + const char *prgname = g_get_prgname(); g_return_if_fail(prgname); @@ -209,30 +209,21 @@ nm_main_utils_ensure_not_running_pidfile(const char *pidfile) } } -void -nm_main_utils_ensure_root() -{ - if (getuid() != 0) { - fprintf(stderr, _("You must be root to run %s!\n"), g_get_prgname() ?: ""); - exit(1); - } -} - gboolean -nm_main_utils_early_setup(const char * progname, - int * argc, - char ** argv[], +nm_main_utils_early_setup(const char *progname, + int *argc, + char **argv[], GOptionEntry *options, void (*option_context_hook)(gpointer user_data, GOptionContext *opt_ctx), gpointer option_context_hook_data, const char *summary) { GOptionContext *opt_ctx = NULL; - GError * error = NULL; + GError *error = NULL; gboolean success = FALSE; int i; - const char * opt_fmt_log_level = NULL, *opt_fmt_log_domains = NULL; - const char ** opt_loc_log_level = NULL, **opt_loc_log_domains = NULL; + const char *opt_fmt_log_level = NULL, *opt_fmt_log_domains = NULL; + const char **opt_loc_log_level = NULL, **opt_loc_log_domains = NULL; /* Make GIO ignore the remote VFS service; otherwise it tries to use the * session bus to contact the remote service, and NM shouldn't ever be |