mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-05 01:47:58 +02:00
systemd: merge branch systemd into master
Update systemd code from upstream. In the meantime, two patches that we applied early in NetworkManager core were applied in upstream systemd too. So, resync.
This commit is contained in:
commit
8c3295f447
7 changed files with 20 additions and 8 deletions
|
|
@ -248,5 +248,4 @@ int log_syntax_internal(
|
|||
log_syntax_internal(unit, _level, config_file, config_line, 0, __FILE__, __LINE__, __func__, \
|
||||
"String is not UTF-8 clean, ignoring assignment: %s", strna(_p)); \
|
||||
} \
|
||||
-EINVAL; \
|
||||
})
|
||||
|
|
|
|||
|
|
@ -23,10 +23,15 @@
|
|||
#include <inttypes.h>
|
||||
#include <stdbool.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysmacros.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#define _printf_(a,b) __attribute__ ((format (printf, a, b)))
|
||||
#define _alloc_(...) __attribute__ ((alloc_size(__VA_ARGS__)))
|
||||
#ifdef __clang__
|
||||
# define _alloc_(...)
|
||||
#else
|
||||
# define _alloc_(...) __attribute__ ((alloc_size(__VA_ARGS__)))
|
||||
#endif
|
||||
#define _sentinel_ __attribute__ ((sentinel))
|
||||
#define _unused_ __attribute__ ((unused))
|
||||
#define _destructor_ __attribute__ ((destructor))
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/statfs.h>
|
||||
#include <sys/sysmacros.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
|
|
|||
|
|
@ -448,7 +448,7 @@ static int format_mac_address(const void *data, size_t sz, char **ret) {
|
|||
|
||||
static int format_network_address(const void *data, size_t sz, char **ret) {
|
||||
union in_addr_union a;
|
||||
int family;
|
||||
int family, r;
|
||||
|
||||
if (sz == 6 && ((uint8_t*) data)[1] == 1) {
|
||||
memcpy(&a.in, (uint8_t*) data + 2, sizeof(a.in));
|
||||
|
|
@ -459,7 +459,10 @@ static int format_network_address(const void *data, size_t sz, char **ret) {
|
|||
} else
|
||||
return 0;
|
||||
|
||||
return in_addr_to_string(family, &a, ret);
|
||||
r = in_addr_to_string(family, &a, ret);
|
||||
if (r < 0)
|
||||
return r;
|
||||
return 1;
|
||||
}
|
||||
|
||||
_public_ int sd_lldp_neighbor_get_chassis_id_as_string(sd_lldp_neighbor *n, const char **ret) {
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@
|
|||
#endif
|
||||
|
||||
#define _SD_DEFINE_POINTER_CLEANUP_FUNC(type, func) \
|
||||
static inline void func##p(type **p) { \
|
||||
static __inline__ void func##p(type **p) { \
|
||||
if (*p) \
|
||||
func(*p); \
|
||||
} \
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ enum {
|
|||
SD_EVENT_RUNNING,
|
||||
SD_EVENT_EXITING,
|
||||
SD_EVENT_FINISHED,
|
||||
SD_EVENT_PREPARING,
|
||||
SD_EVENT_PREPARING
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
@ -69,7 +69,11 @@ typedef int (*sd_event_handler_t)(sd_event_source *s, void *userdata);
|
|||
typedef int (*sd_event_io_handler_t)(sd_event_source *s, int fd, uint32_t revents, void *userdata);
|
||||
typedef int (*sd_event_time_handler_t)(sd_event_source *s, uint64_t usec, void *userdata);
|
||||
typedef int (*sd_event_signal_handler_t)(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata);
|
||||
#if defined __USE_POSIX199309 || defined __USE_XOPEN_EXTENDED
|
||||
typedef int (*sd_event_child_handler_t)(sd_event_source *s, const siginfo_t *si, void *userdata);
|
||||
#else
|
||||
typedef void* sd_event_child_handler_t;
|
||||
#endif
|
||||
|
||||
int sd_event_default(sd_event **e);
|
||||
|
||||
|
|
|
|||
|
|
@ -100,11 +100,11 @@ int sd_id128_get_boot(sd_id128_t *ret);
|
|||
((x).bytes[15] & 15) >= 10 ? 'a' + ((x).bytes[15] & 15) - 10 : '0' + ((x).bytes[15] & 15), \
|
||||
0 })
|
||||
|
||||
_sd_pure_ static inline int sd_id128_equal(sd_id128_t a, sd_id128_t b) {
|
||||
_sd_pure_ static __inline__ int sd_id128_equal(sd_id128_t a, sd_id128_t b) {
|
||||
return memcmp(&a, &b, 16) == 0;
|
||||
}
|
||||
|
||||
_sd_pure_ static inline int sd_id128_is_null(sd_id128_t a) {
|
||||
_sd_pure_ static __inline__ int sd_id128_is_null(sd_id128_t a) {
|
||||
return a.qwords[0] == 0 && a.qwords[1] == 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue