chiark / gitweb /
test: only use assert_se
[elogind.git] / src / test / test-tmpfiles.c
index f25a0dca525b96d30b75eb35e33a59200bf07921..84050c6fa4a010a70a5b74d9b2a98034570378ee 100644 (file)
@@ -34,14 +34,14 @@ int main(int argc, char** argv) {
         _cleanup_close_ int fd, fd2;
         _cleanup_free_ char *cmd, *cmd2;
 
-        fd = open_tmpfile(p, O_RDWR);
-        assert(fd >= 0);
+        fd = open_tmpfile(p, O_RDWR|O_CLOEXEC);
+        assert_se(fd >= 0);
 
         assert_se(asprintf(&cmd, "ls -l /proc/"PID_FMT"/fd/%d", getpid(), fd) > 0);
         system(cmd);
 
-        fd2 = mkostemp_safe(pattern, O_RDWR);
-        assert(fd >= 0);
+        fd2 = mkostemp_safe(pattern, O_RDWR|O_CLOEXEC);
+        assert_se(fd >= 0);
         assert_se(unlink(pattern) == 0);
 
         assert_se(asprintf(&cmd2, "ls -l /proc/"PID_FMT"/fd/%d", getpid(), fd2) > 0);