From f755c7b1db44194fdbd8a0d9beded3c1a5604a76 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 18 Jan 2022 17:14:23 +0100 Subject: [PATCH] core: remove unused function nm_main_utils_ensure_root() --- src/core/main-utils.c | 9 --------- src/core/main-utils.h | 2 -- 2 files changed, 11 deletions(-) diff --git a/src/core/main-utils.c b/src/core/main-utils.c index 14685fc3b4..0e1f5b89a8 100644 --- a/src/core/main-utils.c +++ b/src/core/main-utils.c @@ -209,15 +209,6 @@ 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); - } -} - uid_t nm_uid; /** * nm_main_utils_get_nm_uid: diff --git a/src/core/main-utils.h b/src/core/main-utils.h index d947dcaebd..0f3ee50dc0 100644 --- a/src/core/main-utils.h +++ b/src/core/main-utils.h @@ -6,8 +6,6 @@ #ifndef __MAIN_UTILS_H__ #define __MAIN_UTILS_H__ -void nm_main_utils_ensure_root(void); - uid_t nm_main_utils_get_nm_uid(void); gid_t nm_main_utils_get_nm_gid(void);