core: use explict NMLogDomain enum instead of int
A while ago (f4f3f4d69b
) we added an
enum to represent the logging domain. Use it.
This commit is contained in:
@@ -354,7 +354,7 @@ nm_utils_get_start_time_for_pid (pid_t pid)
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
guint64 log_domain;
|
NMLogDomain log_domain;
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
gint64 wait_start_us;
|
gint64 wait_start_us;
|
||||||
@@ -376,7 +376,7 @@ typedef struct {
|
|||||||
#define LOG_NAME_ARGS log_name,(long)pid
|
#define LOG_NAME_ARGS log_name,(long)pid
|
||||||
|
|
||||||
static KillChildAsyncData *
|
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;
|
KillChildAsyncData *data;
|
||||||
size_t log_name_len;
|
size_t log_name_len;
|
||||||
@@ -491,7 +491,7 @@ _kc_invoke_callback_idle (gpointer user_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
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;
|
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.
|
* supports only one watcher per child.
|
||||||
**/
|
**/
|
||||||
void
|
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,
|
const char *log_name, guint32 wait_before_kill_msec,
|
||||||
NMUtilsKillChildAsyncCb callback, void *user_data)
|
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.
|
* In case of error, errno is preserved to contain the last reason of failure.
|
||||||
**/
|
**/
|
||||||
gboolean
|
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,
|
int *child_status, guint32 wait_before_kill_msec,
|
||||||
guint32 sleep_duration_msec)
|
guint32 sleep_duration_msec)
|
||||||
{
|
{
|
||||||
@@ -801,7 +801,7 @@ out:
|
|||||||
* process with PID @pid is gone.
|
* process with PID @pid is gone.
|
||||||
**/
|
**/
|
||||||
void
|
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,
|
const char *log_name, guint32 wait_before_kill_msec,
|
||||||
guint32 sleep_duration_msec)
|
guint32 sleep_duration_msec)
|
||||||
{
|
{
|
||||||
|
@@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
#include "nm-device.h"
|
#include "nm-device.h"
|
||||||
|
|
||||||
|
#include "nm-logging.h"
|
||||||
|
|
||||||
/* This file should only be used by subclasses of NMDevice */
|
/* This file should only be used by subclasses of NMDevice */
|
||||||
|
|
||||||
#define NM_DEVICE_PLATFORM_DEVICE "platform-device"
|
#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);
|
NMDevice *nm_device_master_get_slave_by_ifindex (NMDevice *dev, int ifindex);
|
||||||
|
|
||||||
void nm_device_master_check_slave_physical_port (NMDevice *self, NMDevice *slave,
|
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);
|
void nm_device_set_carrier (NMDevice *self, gboolean carrier);
|
||||||
|
|
||||||
|
@@ -160,7 +160,7 @@ typedef struct {
|
|||||||
} SlaveInfo;
|
} SlaveInfo;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
guint log_domain;
|
NMLogDomain log_domain;
|
||||||
guint timeout;
|
guint timeout;
|
||||||
guint watch;
|
guint watch;
|
||||||
GPid pid;
|
GPid pid;
|
||||||
@@ -1625,7 +1625,7 @@ nm_device_master_get_slave_by_ifindex (NMDevice *self, int ifindex)
|
|||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
nm_device_master_check_slave_physical_port (NMDevice *self, NMDevice *slave,
|
nm_device_master_check_slave_physical_port (NMDevice *self, NMDevice *slave,
|
||||||
guint64 log_domain)
|
NMLogDomain log_domain)
|
||||||
{
|
{
|
||||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||||
const char *slave_physical_port_id, *existing_physical_port_id;
|
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);
|
NMDevice *self = NM_DEVICE (user_data);
|
||||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
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)
|
if (!priv->gw_ping.watch)
|
||||||
return;
|
return;
|
||||||
@@ -6470,7 +6470,7 @@ ip_check_ping_timeout_cb (gpointer user_data)
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
spawn_ping (NMDevice *self,
|
spawn_ping (NMDevice *self,
|
||||||
guint log_domain,
|
NMLogDomain log_domain,
|
||||||
const char *binary,
|
const char *binary,
|
||||||
const char *address,
|
const char *address,
|
||||||
guint timeout)
|
guint timeout)
|
||||||
@@ -6520,7 +6520,7 @@ nm_device_start_ip_check (NMDevice *self)
|
|||||||
guint timeout = 0;
|
guint timeout = 0;
|
||||||
const char *ping_binary = NULL;
|
const char *ping_binary = NULL;
|
||||||
char buf[INET6_ADDRSTRLEN] = { 0 };
|
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
|
/* Shouldn't be any active ping here, since IP_CHECK happens after the
|
||||||
* first IP method completes. Any subsequently completing IP method doesn't
|
* first IP method completes. Any subsequently completing IP method doesn't
|
||||||
|
Reference in New Issue
Block a user