diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2019-03-12 15:16:42 +0100 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2019-03-12 15:16:42 +0100 |
| commit | cc4ab276f923ded9f415c1c2bf192994367ab0bb (patch) | |
| tree | ac3a7775665992b27d07eb44186d38ff961a8cd7 /src/nm-iface-helper.c | |
| parent | bb1cf58350bb34463e9ffc5f96ac4f9b6bf46d28 (diff) | |
| parent | dd428301eb6f02542015121d7b08d9997f137e50 (diff) | |
Update upstream source from tag 'upstream/1.15.91'
Update to upstream version '1.15.91' with Debian dir 74de38245314cab529c6c94cd9d0b874ce0c2994
Diffstat (limited to 'src/nm-iface-helper.c')
| -rw-r--r-- | src/nm-iface-helper.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/nm-iface-helper.c b/src/nm-iface-helper.c index 1229ad35..1ef9f5ae 100644 --- a/src/nm-iface-helper.c +++ b/src/nm-iface-helper.c @@ -23,11 +23,9 @@ #include <glib-unix.h> #include <getopt.h> #include <locale.h> -#include <errno.h> #include <stdlib.h> #include <unistd.h> #include <fcntl.h> -#include <string.h> #include <sys/resource.h> #include <sys/stat.h> #include <signal.h> @@ -389,6 +387,7 @@ main (int argc, char *argv[]) gs_unref_bytes GBytes *client_id = NULL; gs_free NMUtilsIPv6IfaceId *iid = NULL; guint sd_id; + int errsv; c_list_init (&gl.dad_failed_lst_head); @@ -397,11 +396,11 @@ main (int argc, char *argv[]) if (!do_early_setup (&argc, &argv)) return 1; - nm_logging_set_syslog_identifier ("nm-iface-helper"); - nm_logging_set_prefix ("%s[%ld] (%s): ", - _NMLOG_PREFIX_NAME, - (long) getpid (), - global_opt.ifname ?: "???"); + nm_logging_init_pre ("nm-iface-helper", + g_strdup_printf ("%s[%ld] (%s): ", + _NMLOG_PREFIX_NAME, + (long) getpid (), + global_opt.ifname ?: "???")); if (global_opt.g_fatal_warnings) { GLogLevelFlags fatal_mask; @@ -425,7 +424,8 @@ main (int argc, char *argv[]) gl.ifindex = nmp_utils_if_nametoindex (global_opt.ifname); if (gl.ifindex <= 0) { - fprintf (stderr, _("Failed to find interface index for %s (%s)\n"), global_opt.ifname, strerror (errno)); + errsv = errno; + fprintf (stderr, _("Failed to find interface index for %s (%s)\n"), global_opt.ifname, nm_strerror_native (errsv)); return 1; } pidfile = g_strdup_printf (NMIH_PID_FILE_FMT, gl.ifindex); @@ -450,12 +450,10 @@ main (int argc, char *argv[]) if (global_opt.become_daemon && !global_opt.debug) { 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); return 1; } if (nm_main_utils_write_pidfile (pidfile)) @@ -466,8 +464,8 @@ main (int argc, char *argv[]) gl.main_loop = g_main_loop_new (NULL, FALSE); setup_signals (); - nm_logging_syslog_openlog (global_opt.logging_backend, - global_opt.debug); + nm_logging_init (global_opt.logging_backend, + global_opt.debug); _LOGI (LOGD_CORE, "nm-iface-helper (version " NM_DIST_VERSION ") is starting..."); |