summaryrefslogtreecommitdiff
path: root/src/test/test-socket-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-12-19 13:20:30 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-12-19 15:00:59 +0100
commit3401477982d09e0c9815ae5a69e56f43f187967e (patch)
treefdf3ce225df76b9e643835928dc29aeef02a51fc /src/test/test-socket-util.c
parenta5937dcf3902ecb90777f259f6e006292eb54251 (diff)
downloadsystemd-3401477982d09e0c9815ae5a69e56f43f187967e.tar.gz
tree-wide: use -EBADF also in pipe initializers
In some places, initialization is dropped when unnecesary.
Diffstat (limited to 'src/test/test-socket-util.c')
-rw-r--r--src/test/test-socket-util.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/test/test-socket-util.c b/src/test/test-socket-util.c
index 6456316aae..dbafe8b058 100644
--- a/src/test/test-socket-util.c
+++ b/src/test/test-socket-util.c
@@ -223,7 +223,7 @@ TEST(getpeercred_getpeergroups) {
TEST(passfd_read) {
static const char file_contents[] = "test contents for passfd";
- _cleanup_close_pair_ int pair[2] = { -1, -1 };
+ _cleanup_close_pair_ int pair[2];
int r;
assert_se(socketpair(AF_UNIX, SOCK_DGRAM, 0, pair) >= 0);
@@ -263,7 +263,7 @@ TEST(passfd_read) {
}
TEST(passfd_contents_read) {
- _cleanup_close_pair_ int pair[2] = { -1, -1 };
+ _cleanup_close_pair_ int pair[2];
static const char file_contents[] = "test contents in the file";
static const char wire_contents[] = "test contents on the wire";
int r;
@@ -311,7 +311,7 @@ TEST(passfd_contents_read) {
}
TEST(receive_nopassfd) {
- _cleanup_close_pair_ int pair[2] = { -1, -1 };
+ _cleanup_close_pair_ int pair[2];
static const char wire_contents[] = "no fd passed here";
int r;
@@ -348,7 +348,7 @@ TEST(receive_nopassfd) {
}
TEST(send_nodata_nofd) {
- _cleanup_close_pair_ int pair[2] = { -1, -1 };
+ _cleanup_close_pair_ int pair[2];
int r;
assert_se(socketpair(AF_UNIX, SOCK_DGRAM, 0, pair) >= 0);
@@ -381,7 +381,7 @@ TEST(send_nodata_nofd) {
}
TEST(send_emptydata) {
- _cleanup_close_pair_ int pair[2] = { -1, -1 };
+ _cleanup_close_pair_ int pair[2];
int r;
assert_se(socketpair(AF_UNIX, SOCK_DGRAM, 0, pair) >= 0);