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.
This commit is contained in:
Thomas Haller 2015-07-08 16:53:40 +02:00
parent 09ba572174
commit 9020cd1aac
4 changed files with 0 additions and 11 deletions

View file

@ -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);

View file

@ -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);

View file

@ -488,9 +488,3 @@ nm_logging_syslog_openlog (gboolean debug)
}
}
void
nm_logging_syslog_closelog (void)
{
if (syslog_opened)
closelog ();
}

View file

@ -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__ */