summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2023-02-23 09:48:54 +0100
committerDavid Tardon <dtardon@redhat.com>2023-02-23 09:48:54 +0100
commit92651a7a2d291ca6bc4d16b1861e494d44870365 (patch)
tree30824a7227cf1cb487a23d8e3a6079c5721f55bf /src/test
parentsd-event: fix error handling (diff)
downloadsystemd-92651a7a2d291ca6bc4d16b1861e494d44870365.tar.xz
systemd-92651a7a2d291ca6bc4d16b1861e494d44870365.zip
tree-wide: initialize fds with -EBADF
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-mempress.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test-mempress.c b/src/test/test-mempress.c
index 3371965ac3..510c732715 100644
--- a/src/test/test-mempress.c
+++ b/src/test/test-mempress.c
@@ -28,7 +28,7 @@ struct fake_pressure_context {
static void *fake_pressure_thread(void *p) {
_cleanup_free_ struct fake_pressure_context *c = ASSERT_PTR(p);
- _cleanup_close_ int cfd = -1;
+ _cleanup_close_ int cfd = -EBADF;
usleep(150);
@@ -68,7 +68,7 @@ TEST(fake_pressure) {
_cleanup_(sd_event_unrefp) sd_event *e = NULL;
_cleanup_free_ char *j = NULL, *k = NULL;
_cleanup_(rm_rf_physical_and_freep) char *tmp = NULL;
- _cleanup_close_ int fifo_fd = -1, socket_fd = -1;
+ _cleanup_close_ int fifo_fd = -EBADF, socket_fd = -EBADF;
union sockaddr_union sa;
pthread_t th;
int value = 7;