summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-netlink/sd-netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd/sd-netlink/sd-netlink.c')
-rw-r--r--src/libsystemd/sd-netlink/sd-netlink.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libsystemd/sd-netlink/sd-netlink.c b/src/libsystemd/sd-netlink/sd-netlink.c
index fe888926a1..132f63e57d 100644
--- a/src/libsystemd/sd-netlink/sd-netlink.c
+++ b/src/libsystemd/sd-netlink/sd-netlink.c
@@ -31,7 +31,7 @@ static int netlink_new(sd_netlink **ret) {
*nl = (sd_netlink) {
.n_ref = 1,
- .fd = -1,
+ .fd = -EBADF,
.sockaddr.nl.nl_family = AF_NETLINK,
.original_pid = getpid_cached(),
.protocol = -1,
@@ -93,7 +93,7 @@ int sd_netlink_open_fd(sd_netlink **ret, int fd) {
r = socket_bind(nl);
if (r < 0) {
- nl->fd = -1; /* on failure, the caller remains owner of the fd, hence don't close it here */
+ nl->fd = -EBADF; /* on failure, the caller remains owner of the fd, hence don't close it here */
nl->protocol = -1;
return r;
}