From 1b6707f44e7fd7e2d0dab74acf9dc576e15f4e7f Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Sun, 3 Oct 2021 12:42:16 +0200 Subject: [PATCH] test: investigate why tempfile() fails on debian:stable Signed-off-by: Joachim Wiberg --- test/tempfile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/tempfile.c b/test/tempfile.c index 9c72f76..b79f39e 100644 --- a/test/tempfile.c +++ b/test/tempfile.c @@ -18,8 +18,11 @@ int main(void) printf("Before tempfile():\n"); system("ls -lrt " _PATH_TMP " | tail -3"); + fflush(stdout); fp = tempfile(); + if (fp == NULL) + fprintf(stderr, "Failed tempfile(), errno %d: %s", errno, strerror(errno)); fail_unless(fp != NULL); fputs(READBACK, fp); @@ -30,6 +33,7 @@ int main(void) printf("\nAfter tempfile(), should be same list:\n"); system("ls -lrt " _PATH_TMP " | tail -3"); + fflush(stdout); return fclose(fp); }