aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasatake YAMATO <yamato@redhat.com>2024-04-03 00:01:27 +0900
committerMasatake YAMATO <yamato@redhat.com>2024-04-03 00:01:27 +0900
commitacdba9c454506cdd29ac400df3f72bde4c74647d (patch)
tree422429e005d492df9d92ded2cace7e50244c1d1b
parent20a740eb7c19d9bb343a8ca927d1c27402a1da5c (diff)
downloadutil-linux-acdba9c454506cdd29ac400df3f72bde4c74647d.tar.gz
tests: (test_mkfds::netlink) pass a correct file descriptor to bind(2)
Close #2901 The original code passed a closed file descriptor to bind(2). Signed-off-by: Masatake YAMATO <yamato@redhat.com>
-rw-r--r--tests/helpers/test_mkfds.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/helpers/test_mkfds.c b/tests/helpers/test_mkfds.c
index dd0a128a88..28ed3bffcb 100644
--- a/tests/helpers/test_mkfds.c
+++ b/tests/helpers/test_mkfds.c
@@ -2293,6 +2293,7 @@ static void *make_netlink(const struct factory *factory, struct fdesc fdescs[],
err(EXIT_FAILURE, "failed to dup %d -> %d", sd, fdescs[0].fd);
}
close(sd);
+ sd = fdescs[0].fd;
}
struct sockaddr_nl nl;