mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-21 09:30:39 +01:00
core/logging: remove thread-safe initialization guard for nm_logging_syslog_openlog()
The logging routines are not thread-safe in general, so there is no need for trying to make nm_logging_syslog_openlog() thread-safe. Also nm_logging_syslog_openlog() is only called by the main() routine. Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
parent
7ac7249fc8
commit
48b4d0eaf2
1 changed files with 3 additions and 5 deletions
|
|
@ -460,20 +460,18 @@ nm_log_handler (const gchar *log_domain,
|
|||
void
|
||||
nm_logging_syslog_openlog (gboolean debug)
|
||||
{
|
||||
static gsize log_handler_initialized = 0;
|
||||
|
||||
if (debug)
|
||||
openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR | LOG_PID, LOG_USER);
|
||||
else
|
||||
openlog (G_LOG_DOMAIN, LOG_PID, LOG_DAEMON);
|
||||
syslog_opened = TRUE;
|
||||
|
||||
if (g_once_init_enter (&log_handler_initialized)) {
|
||||
if (!syslog_opened) {
|
||||
syslog_opened = TRUE;
|
||||
|
||||
g_log_set_handler (G_LOG_DOMAIN,
|
||||
G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
|
||||
nm_log_handler,
|
||||
NULL);
|
||||
g_once_init_leave (&log_handler_initialized, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue