/* Returns: the old fatal mask for the log domain  */
GLogLevelFlags g_log_set_fatal_mask(const gchar *log_domain, GLogLevelFlags fatal_mask)
/* Returns: the old fatal mask for the log domain  */
GLogLevelFlags g_log_set_fatal_mask(const gchar *log_domain, GLogLevelFlags fatal_mask)
{
  GLogLevelFlags old_flags;
  GLogDomain *domain;
  if (!log_domain)
    log_domain = "";
  fatal_mask |= G_LOG_LEVEL_ERROR;
  fatal_mask &= ~G_LOG_FLAG_FATAL;
  g_mutex_lock (&g_messages_lock);
  domain = g_log_find_domain_L (log_domain);
  if (!domain)
    domain = g_log_domain_new_L (log_domain);
  old_flags = domain->fatal_mask;
  domain->fatal_mask = fatal_mask;
  g_log_domain_check_free_L (domain);
  g_mutex_unlock (&g_messages_lock);
  return old_flags;
}