mirror of
https://github.com/systemd/systemd.git
synced 2025-01-31 05:47:30 +03:00
network: move log_message_warning_errno() to networkd-util.h
This commit is contained in:
parent
ca183bf8fd
commit
0d7d377b80
@ -46,13 +46,6 @@
|
||||
/* use 128 MB for receive socket kernel queue. */
|
||||
#define RCVBUF_SIZE (128*1024*1024)
|
||||
|
||||
static int log_message_warning_errno(sd_netlink_message *m, int err, const char *msg) {
|
||||
const char *err_msg = NULL;
|
||||
|
||||
(void) sd_netlink_message_read_string(m, NLMSGERR_ATTR_MSG, &err_msg);
|
||||
return log_warning_errno(err, "%s: %s%s%m", msg, strempty(err_msg), err_msg ? " " : "");
|
||||
}
|
||||
|
||||
static int setup_default_address_pool(Manager *m) {
|
||||
AddressPool *p;
|
||||
int r;
|
||||
|
@ -2,10 +2,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "sd-dhcp-lease.h"
|
||||
#include "sd-netlink.h"
|
||||
|
||||
#include "conf-parser.h"
|
||||
#include "hash-funcs.h"
|
||||
#include "log.h"
|
||||
#include "macro.h"
|
||||
#include "string-util.h"
|
||||
|
||||
typedef enum AddressFamily {
|
||||
/* This is a bitmask, though it usually doesn't feel that way! */
|
||||
@ -70,3 +73,10 @@ static inline bool section_is_invalid(NetworkConfigSection *section) {
|
||||
} \
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(type*, free_func); \
|
||||
DEFINE_TRIVIAL_CLEANUP_FUNC(type*, free_func##_or_set_invalid);
|
||||
|
||||
static inline int log_message_warning_errno(sd_netlink_message *m, int err, const char *msg) {
|
||||
const char *err_msg = NULL;
|
||||
|
||||
(void) sd_netlink_message_read_string(m, NLMSGERR_ATTR_MSG, &err_msg);
|
||||
return log_warning_errno(err, "%s: %s%s%m", msg, strempty(err_msg), err_msg ? " " : "");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user