summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-07-08 16:53:40 +0200
committerThomas Haller <thaller@redhat.com>2015-07-14 15:52:50 +0200
commit9020cd1aacf26a03cf1bc46b040d42a791a89935 (patch)
tree0fd5cb155c3c42b72f533658d1dbbbc6260b4c1e
parent09ba572174e9109988ede039342b6098d61bc7e0 (diff)
downloadNetworkManager-9020cd1aacf26a03cf1bc46b040d42a791a89935.tar.gz
logging: remove nm_logging_syslog_closelog()
Remove nm_logging_syslog_closelog(). The reasons are: - closelog() is optional according to the manual. - we called nm_logging_syslog_closelog() at the end of the main() function. But we have destructors running afterwards, so we were closing the log before logging the last line. Apparently that had no bad consequences either, so why was closelog() even useful? Also, it's hard to determine when we log the last line and only closelog() afterwards. - closelog() does not revert what openlog() did, this is ugly.
-rw-r--r--src/main.c2
-rw-r--r--src/nm-iface-helper.c2
-rw-r--r--src/nm-logging.c6
-rw-r--r--src/nm-logging.h1
4 files changed, 0 insertions, 11 deletions
diff --git a/src/main.c b/src/main.c
index ad44471df6..7b1e522467 100644
--- a/src/main.c
+++ b/src/main.c
@@ -486,8 +486,6 @@ main (int argc, char *argv[])
done:
g_clear_object (&manager);
- nm_logging_syslog_closelog ();
-
if (global_opt.pidfile && wrote_pidfile)
unlink (global_opt.pidfile);
diff --git a/src/nm-iface-helper.c b/src/nm-iface-helper.c
index cbff221a85..72b69590b4 100644
--- a/src/nm-iface-helper.c
+++ b/src/nm-iface-helper.c
@@ -481,8 +481,6 @@ main (int argc, char *argv[])
g_clear_pointer (&hwaddr, g_byte_array_unref);
- nm_logging_syslog_closelog ();
-
if (pidfile && wrote_pidfile)
unlink (pidfile);
diff --git a/src/nm-logging.c b/src/nm-logging.c
index d8dc4291ac..d4fe998ecf 100644
--- a/src/nm-logging.c
+++ b/src/nm-logging.c
@@ -488,9 +488,3 @@ nm_logging_syslog_openlog (gboolean debug)
}
}
-void
-nm_logging_syslog_closelog (void)
-{
- if (syslog_opened)
- closelog ();
-}
diff --git a/src/nm-logging.h b/src/nm-logging.h
index d02e16528f..7ed966f85a 100644
--- a/src/nm-logging.h
+++ b/src/nm-logging.h
@@ -164,6 +164,5 @@ gboolean nm_logging_setup (const char *level,
char **bad_domains,
GError **error);
void nm_logging_syslog_openlog (gboolean debug);
-void nm_logging_syslog_closelog (void);
#endif /* __NETWORKMANAGER_LOGGING_H__ */