diff options
| author | Michael Biebl <biebl@debian.org> | 2019-03-26 23:25:23 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2019-03-26 23:25:23 +0100 |
| commit | 9a6dcbf895f9da01768e64b73cec88c16157d91e (patch) | |
| tree | a359958930d731e9f1b59344642e10754419fe84 /src/main.c | |
| parent | 964ae8cc391520440cf5aa13e2b9cc34850ea6c2 (diff) | |
New upstream version 1.16.0 upstream/1.16.0
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/main.c b/src/main.c index f834fa94..9f979cf4 100644 --- a/src/main.c +++ b/src/main.c @@ -23,15 +23,12 @@ #include <getopt.h> #include <locale.h> -#include <errno.h> #include <stdlib.h> #include <signal.h> -#include <pthread.h> #include <unistd.h> #include <fcntl.h> #include <sys/stat.h> #include <sys/types.h> -#include <string.h> #include <sys/resource.h> #include "main-utils.h" @@ -155,7 +152,7 @@ nm_main_config_reload (int signal) * * Hence, a NMConfig singleton instance must always be * available. */ - nm_config_reload (nm_config_get (), reload_flags); + nm_config_reload (nm_config_get (), reload_flags, TRUE); } static void @@ -232,6 +229,8 @@ main (int argc, char *argv[]) NMConfigCmdLineOptions *config_cli; guint sd_id = 0; GError *error_invalid_logging_config = NULL; + const char *const *warnings; + int errsv; /* Known to cause a possible deadlock upon GDBus initialization: * https://bugzilla.gnome.org/show_bug.cgi?id=674885 */ @@ -333,12 +332,10 @@ main (int argc, char *argv[]) if (global_opt.become_daemon && !nm_config_get_is_debug (config)) { if (daemon (0, 0) < 0) { - int saved_errno; - - saved_errno = errno; + errsv = errno; fprintf (stderr, _("Could not daemonize: %s [error %u]\n"), - g_strerror (saved_errno), - saved_errno); + nm_strerror_native (errsv), + errsv); exit (1); } wrote_pidfile = nm_main_utils_write_pidfile (global_opt.pidfile); @@ -354,7 +351,7 @@ main (int argc, char *argv[]) NM_CONFIG_KEYFILE_GROUP_LOGGING, NM_CONFIG_KEYFILE_KEY_LOGGING_BACKEND, NM_CONFIG_GET_VALUE_STRIP | NM_CONFIG_GET_VALUE_NO_EMPTY); - nm_logging_syslog_openlog (v, nm_config_get_is_debug (config)); + nm_logging_init (v, nm_config_get_is_debug (config)); } nm_log_info (LOGD_CORE, "NetworkManager (version " NM_DIST_VERSION ") is starting... (%s)", @@ -376,6 +373,11 @@ main (int argc, char *argv[]) nm_clear_g_free (&bad_domains); } + warnings = nm_config_get_warnings (config); + for ( ; warnings && *warnings; warnings++) + nm_log_warn (LOGD_CORE, "config: %s", *warnings); + nm_config_clear_warnings (config); + /* the first access to State causes the file to be read (and possibly print a warning) */ nm_config_state_get (config); |