summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-compress.c2
-rw-r--r--src/test/test-copy.c2
-rw-r--r--src/test/test-execute.c2
-rw-r--r--src/test/test-fd-util.c4
-rw-r--r--src/test/test-fileio.c2
-rw-r--r--src/test/test-terminal-util.c2
6 files changed, 7 insertions, 7 deletions
diff --git a/src/test/test-compress.c b/src/test/test-compress.c
index 339482a438..f5ec47cb3c 100644
--- a/src/test/test-compress.c
+++ b/src/test/test-compress.c
@@ -170,7 +170,7 @@ _unused_ static void test_compress_stream(int flag,
decompress_stream_t decompress,
const char *srcfile) {
- _cleanup_close_ int src = -1, dst = -1, dst2 = -1;
+ _cleanup_close_ int src = -EBADF, dst = -EBADF, dst2 = -EBADF;
_cleanup_(unlink_tempfilep) char
pattern[] = "/tmp/systemd-test.compressed.XXXXXX",
pattern2[] = "/tmp/systemd-test.compressed.XXXXXX";
diff --git a/src/test/test-copy.c b/src/test/test-copy.c
index 662481d337..5a4af174fe 100644
--- a/src/test/test-copy.c
+++ b/src/test/test-copy.c
@@ -78,7 +78,7 @@ TEST(copy_tree_replace_file) {
TEST(copy_tree_replace_dirs) {
_cleanup_(rm_rf_physical_and_freep) char *srcp = NULL, *dstp = NULL;
- _cleanup_close_ int src = -1, dst = -1;
+ _cleanup_close_ int src = -EBADF, dst = -EBADF;
/* Create the random source/destination directories */
assert_se((src = mkdtemp_open(NULL, 0, &srcp)) >= 0);
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
index 76342d9a82..7fe78207e0 100644
--- a/src/test/test-execute.c
+++ b/src/test/test-execute.c
@@ -576,7 +576,7 @@ static int find_libraries(const char *exec, char ***ret) {
r = safe_fork("(spawn-ldd)", FORK_RESET_SIGNALS|FORK_DEATHSIG|FORK_LOG, &pid);
assert_se(r >= 0);
if (r == 0) {
- if (rearrange_stdio(-1, TAKE_FD(outpipe[1]), TAKE_FD(errpipe[1])) < 0)
+ if (rearrange_stdio(-EBADF, TAKE_FD(outpipe[1]), TAKE_FD(errpipe[1])) < 0)
_exit(EXIT_FAILURE);
(void) close_all_fds(NULL, 0);
diff --git a/src/test/test-fd-util.c b/src/test/test-fd-util.c
index 5068f8edf7..1ca9ef8bbd 100644
--- a/src/test/test-fd-util.c
+++ b/src/test/test-fd-util.c
@@ -133,7 +133,7 @@ TEST(rearrange_stdio) {
safe_close(STDERR_FILENO); /* Let's close an fd < 2, to make it more interesting */
- assert_se(rearrange_stdio(-1, -1, -1) >= 0);
+ assert_se(rearrange_stdio(-EBADF, -EBADF, -EBADF) >= 0);
assert_se(fd_get_path(STDIN_FILENO, &path) >= 0);
assert_se(path_equal(path, "/dev/null"));
@@ -170,7 +170,7 @@ TEST(rearrange_stdio) {
assert_se(read(0, buffer, sizeof(buffer)) == 6);
assert_se(memcmp(buffer, "foobar", 6) == 0);
- assert_se(rearrange_stdio(-1, 1, 2) >= 0);
+ assert_se(rearrange_stdio(-EBADF, 1, 2) >= 0);
assert_se(write(1, "a", 1) < 0 && errno == ENOSPC);
assert_se(write(2, "y", 1) == 1);
assert_se(read(3, buffer, sizeof(buffer)) == 1);
diff --git a/src/test/test-fileio.c b/src/test/test-fileio.c
index 2009c0f972..9d9c719875 100644
--- a/src/test/test-fileio.c
+++ b/src/test/test-fileio.c
@@ -877,7 +877,7 @@ TEST(read_nul_string) {
TEST(read_full_file_socket) {
_cleanup_(rm_rf_physical_and_freep) char *z = NULL;
- _cleanup_close_ int listener = -1;
+ _cleanup_close_ int listener = -EBADF;
_cleanup_free_ char *data = NULL, *clientname = NULL;
union sockaddr_union sa;
const char *j, *jj;
diff --git a/src/test/test-terminal-util.c b/src/test/test-terminal-util.c
index 8d0e452038..8d5b24e502 100644
--- a/src/test/test-terminal-util.c
+++ b/src/test/test-terminal-util.c
@@ -66,7 +66,7 @@ TEST(read_one_char) {
TEST(getttyname_malloc) {
_cleanup_free_ char *ttyname = NULL;
- _cleanup_close_ int master = -1;
+ _cleanup_close_ int master = -EBADF;
assert_se((master = posix_openpt(O_RDWR|O_NOCTTY)) >= 0);
assert_se(getttyname_malloc(master, &ttyname) >= 0);