Lines Matching refs:fds
26 int fds[3]; in TEST() local
31 fds[0] = mkostemp_safe(name0); in TEST()
32 fds[1] = mkostemp_safe(name1); in TEST()
33 fds[2] = mkostemp_safe(name2); in TEST()
35 close_many(fds, 2); in TEST()
37 assert_se(fcntl(fds[0], F_GETFD) == -1); in TEST()
38 assert_se(fcntl(fds[1], F_GETFD) == -1); in TEST()
39 assert_se(fcntl(fds[2], F_GETFD) >= 0); in TEST()
41 safe_close(fds[2]); in TEST()
193 const int *fds, in validate_fds() argument
206 if (fds[i] < 0) in validate_fds()
210 assert_se(fcntl(fds[i], F_GETFD) >= 0); in validate_fds()
212 assert_se(fcntl(fds[i], F_GETFD) < 0 && errno == EBADF); in validate_fds()
221 _cleanup_free_ int *fds = NULL, *keep = NULL; in test_close_all_fds_inner() local
246 assert_se(fds = new(int, n_fds)); in test_close_all_fds_inner()
248 assert_se(pipe2(fds + i, O_CLOEXEC) >= 0); in test_close_all_fds_inner()
251 assert_se(validate_fds(true, fds, n_fds) == n_fds); in test_close_all_fds_inner()
263 if (fds[p] >= 0) { in test_close_all_fds_inner()
264 keep[k] = TAKE_FD(fds[p]); in test_close_all_fds_inner()
271 assert_se(validate_fds(true, fds, n_fds) == n_fds - n_keep); in test_close_all_fds_inner()
281 assert_se(validate_fds(false, fds, n_fds) == n_fds - n_keep); in test_close_all_fds_inner()
287 assert_se(validate_fds(false, fds, n_fds) == n_fds - n_keep); in test_close_all_fds_inner()