chiark / gitweb /
remove unused includes
[elogind.git] / src / test / test-tmpfiles.c
index 565f0f8b40f391d164416ba31c86c72862086d36..90e49d454233b393be27cb95e144a4de8969face 100644 (file)
@@ -19,8 +19,6 @@
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
-#include <sys/types.h>
-#include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
 #include <stdlib.h>
 
 int main(int argc, char** argv) {
         const char *p = argv[1] ?: "/tmp";
-        char *pattern = strappenda(p, "/systemd-test-XXXXXX");
+        char *pattern = strjoina(p, "/systemd-test-XXXXXX");
         _cleanup_close_ int fd, fd2;
         _cleanup_free_ char *cmd, *cmd2;
 
         fd = open_tmpfile(p, O_RDWR|O_CLOEXEC);
-        assert(fd >= 0);
+        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|O_CLOEXEC);
-        assert(fd >= 0);
+        assert_se(fd >= 0);
         assert_se(unlink(pattern) == 0);
 
         assert_se(asprintf(&cmd2, "ls -l /proc/"PID_FMT"/fd/%d", getpid(), fd2) > 0);