TEST(fdset_remove) {
_cleanup_close_ int fd = -EBADF;
- FDSet *fdset = NULL;
+ _cleanup_fdset_free_ FDSet *fdset = NULL;
char name[] = "/tmp/test-fdset_remove.XXXXXX";
fd = mkostemp_safe(name);
assert_se(fdset_put(fdset, fd) >= 0);
assert_se(fdset_remove(fdset, fd) >= 0);
assert_se(!fdset_contains(fdset, fd));
- fdset_free(fdset);
assert_se(fcntl(fd, F_GETFD) >= 0);
TEST(fdset_iterate) {
int fd = -EBADF;
- FDSet *fdset = NULL;
+ _cleanup_fdset_free_ FDSet *fdset = NULL;
char name[] = "/tmp/test-fdset_iterate.XXXXXX";
int c = 0;
int a;
}
assert_se(c == 1);
- fdset_free(fdset);
-
unlink(name);
}