summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-05-12 16:44:24 +0200
committerThomas Haller <thaller@redhat.com>2015-05-12 16:46:48 +0200
commit067202b34e5a0aa33b441a6e12574cec569d7edb (patch)
treec306357c96cc3d60a2d7c1e8d521de4dd3949129 /src
parente07efa836f5cdb8683f8253dbd9239a0a2c8d23c (diff)
downloadNetworkManager-067202b34e5a0aa33b441a6e12574cec569d7edb.tar.gz
core: use explict NMLogDomain enum instead of int
A while ago (f4f3f4d69b6ff89b5ec7cb9b2ca3758c149f15f5) we added an enum to represent the logging domain. Use it.
Diffstat (limited to 'src')
-rw-r--r--src/NetworkManagerUtils.c12
-rw-r--r--src/devices/nm-device-private.h4
-rw-r--r--src/devices/nm-device.c10
3 files changed, 14 insertions, 12 deletions
diff --git a/src/NetworkManagerUtils.c b/src/NetworkManagerUtils.c
index 82c872175e..368ceb3438 100644
--- a/src/NetworkManagerUtils.c
+++ b/src/NetworkManagerUtils.c
@@ -354,7 +354,7 @@ nm_utils_get_start_time_for_pid (pid_t pid)
typedef struct {
pid_t pid;
- guint64 log_domain;
+ NMLogDomain log_domain;
union {
struct {
gint64 wait_start_us;
@@ -376,7 +376,7 @@ typedef struct {
#define LOG_NAME_ARGS log_name,(long)pid
static KillChildAsyncData *
-_kc_async_data_alloc (pid_t pid, guint64 log_domain, const char *log_name, NMUtilsKillChildAsyncCb callback, void *user_data)
+_kc_async_data_alloc (pid_t pid, NMLogDomain log_domain, const char *log_name, NMUtilsKillChildAsyncCb callback, void *user_data)
{
KillChildAsyncData *data;
size_t log_name_len;
@@ -491,7 +491,7 @@ _kc_invoke_callback_idle (gpointer user_data)
}
static void
-_kc_invoke_callback (pid_t pid, guint64 log_domain, const char *log_name, NMUtilsKillChildAsyncCb callback, void *user_data, gboolean success, int child_status)
+_kc_invoke_callback (pid_t pid, NMLogDomain log_domain, const char *log_name, NMUtilsKillChildAsyncCb callback, void *user_data, gboolean success, int child_status)
{
KillChildAsyncData *data;
@@ -523,7 +523,7 @@ _kc_invoke_callback (pid_t pid, guint64 log_domain, const char *log_name, NMUtil
* supports only one watcher per child.
**/
void
-nm_utils_kill_child_async (pid_t pid, int sig, guint64 log_domain,
+nm_utils_kill_child_async (pid_t pid, int sig, NMLogDomain log_domain,
const char *log_name, guint32 wait_before_kill_msec,
NMUtilsKillChildAsyncCb callback, void *user_data)
{
@@ -628,7 +628,7 @@ _sleep_duration_convert_ms_to_us (guint32 sleep_duration_msec)
* In case of error, errno is preserved to contain the last reason of failure.
**/
gboolean
-nm_utils_kill_child_sync (pid_t pid, int sig, guint64 log_domain, const char *log_name,
+nm_utils_kill_child_sync (pid_t pid, int sig, NMLogDomain log_domain, const char *log_name,
int *child_status, guint32 wait_before_kill_msec,
guint32 sleep_duration_msec)
{
@@ -801,7 +801,7 @@ out:
* process with PID @pid is gone.
**/
void
-nm_utils_kill_process_sync (pid_t pid, guint64 start_time, int sig, guint64 log_domain,
+nm_utils_kill_process_sync (pid_t pid, guint64 start_time, int sig, NMLogDomain log_domain,
const char *log_name, guint32 wait_before_kill_msec,
guint32 sleep_duration_msec)
{
diff --git a/src/devices/nm-device-private.h b/src/devices/nm-device-private.h
index f34969ac3d..19e00e01cb 100644
--- a/src/devices/nm-device-private.h
+++ b/src/devices/nm-device-private.h
@@ -24,6 +24,8 @@
#include "nm-device.h"
+#include "nm-logging.h"
+
/* This file should only be used by subclasses of NMDevice */
#define NM_DEVICE_PLATFORM_DEVICE "platform-device"
@@ -91,7 +93,7 @@ gboolean nm_device_get_enslaved (NMDevice *device);
NMDevice *nm_device_master_get_slave_by_ifindex (NMDevice *dev, int ifindex);
void nm_device_master_check_slave_physical_port (NMDevice *self, NMDevice *slave,
- guint64 log_domain);
+ NMLogDomain log_domain);
void nm_device_set_carrier (NMDevice *self, gboolean carrier);
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index cb996cbcdd..58898a4b7b 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -160,7 +160,7 @@ typedef struct {
} SlaveInfo;
typedef struct {
- guint log_domain;
+ NMLogDomain log_domain;
guint timeout;
guint watch;
GPid pid;
@@ -1625,7 +1625,7 @@ nm_device_master_get_slave_by_ifindex (NMDevice *self, int ifindex)
*/
void
nm_device_master_check_slave_physical_port (NMDevice *self, NMDevice *slave,
- guint64 log_domain)
+ NMLogDomain log_domain)
{
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
const char *slave_physical_port_id, *existing_physical_port_id;
@@ -6431,7 +6431,7 @@ ip_check_ping_watch_cb (GPid pid, gint status, gpointer user_data)
{
NMDevice *self = NM_DEVICE (user_data);
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
- guint log_domain = priv->gw_ping.log_domain;
+ NMLogDomain log_domain = priv->gw_ping.log_domain;
if (!priv->gw_ping.watch)
return;
@@ -6470,7 +6470,7 @@ ip_check_ping_timeout_cb (gpointer user_data)
static gboolean
spawn_ping (NMDevice *self,
- guint log_domain,
+ NMLogDomain log_domain,
const char *binary,
const char *address,
guint timeout)
@@ -6520,7 +6520,7 @@ nm_device_start_ip_check (NMDevice *self)
guint timeout = 0;
const char *ping_binary = NULL;
char buf[INET6_ADDRSTRLEN] = { 0 };
- guint log_domain = LOGD_IP4;
+ NMLogDomain log_domain = LOGD_IP4;
/* Shouldn't be any active ping here, since IP_CHECK happens after the
* first IP method completes. Any subsequently completing IP method doesn't