diff options
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/env-util.c | 3 | ||||
-rw-r--r-- | src/basic/extract-word.c | 2 | ||||
-rw-r--r-- | src/basic/missing.h | 27 | ||||
-rw-r--r-- | src/basic/virt.c | 2 |
4 files changed, 31 insertions, 3 deletions
diff --git a/src/basic/env-util.c b/src/basic/env-util.c index 7c69ccdaf9..96da38d45e 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -395,7 +395,8 @@ int strv_env_replace(char ***l, char *p) { for (f = *l; f && *f; f++) if (env_match(*f, p)) { - free_and_replace(*f, p); + free(*f); + *f = p; strv_env_unset(f + 1, p); return 0; } diff --git a/src/basic/extract-word.c b/src/basic/extract-word.c index d6c1228463..dbe64a9a58 100644 --- a/src/basic/extract-word.c +++ b/src/basic/extract-word.c @@ -48,7 +48,7 @@ int extract_first_word(const char **p, char **ret, const char *separators, Extra /* Bail early if called after last value or with no input */ if (!*p) - goto finish_force_terminate; + goto finish; c = **p; if (!separators) diff --git a/src/basic/missing.h b/src/basic/missing.h index 4c013be608..a5ae5d9e79 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -1076,6 +1076,33 @@ typedef int32_t key_serial_t; #define IFA_F_MCAUTOJOIN 0x400 #endif +#ifndef HAVE_STRUCT_ETHTOOL_LINK_SETTINGS + +#define ETHTOOL_GLINKSETTINGS 0x0000004c /* Get ethtool_link_settings */ +#define ETHTOOL_SLINKSETTINGS 0x0000004d /* Set ethtool_link_settings */ + +struct ethtool_link_settings { + __u32 cmd; + __u32 speed; + __u8 duplex; + __u8 port; + __u8 phy_address; + __u8 autoneg; + __u8 mdio_support; + __u8 eth_tp_mdix; + __u8 eth_tp_mdix_ctrl; + __s8 link_mode_masks_nwords; + __u32 reserved[8]; + __u32 link_mode_masks[0]; + /* layout of link_mode_masks fields: + * __u32 map_supported[link_mode_masks_nwords]; + * __u32 map_advertising[link_mode_masks_nwords]; + * __u32 map_lp_advertising[link_mode_masks_nwords]; + */ +}; + +#endif + #endif #include "missing_syscall.h" diff --git a/src/basic/virt.c b/src/basic/virt.c index 69b0f96183..d8d57381ad 100644 --- a/src/basic/virt.c +++ b/src/basic/virt.c @@ -496,7 +496,7 @@ static int userns_has_mapping(const char *name) { f = fopen(name, "re"); if (!f) { log_debug_errno(errno, "Failed to open %s: %m", name); - return errno == -ENOENT ? false : -errno; + return errno == ENOENT ? false : -errno; } n = getline(&buf, &n_allocated, f); |