summaryrefslogtreecommitdiff
path: root/regress/lib/libc/stdio_threading/fgets/fgets_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'regress/lib/libc/stdio_threading/fgets/fgets_test.c')
-rwxr-xr-xregress/lib/libc/stdio_threading/fgets/fgets_test.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/regress/lib/libc/stdio_threading/fgets/fgets_test.c b/regress/lib/libc/stdio_threading/fgets/fgets_test.c
index c53abbc06bc..7c5008e2adf 100755
--- a/regress/lib/libc/stdio_threading/fgets/fgets_test.c
+++ b/regress/lib/libc/stdio_threading/fgets/fgets_test.c
@@ -48,11 +48,12 @@ main(void)
strlcpy(sfn, "/tmp/barnacles.XXXXXXXX", sizeof(sfn));
if ((fd = mkstemp(sfn)) == -1 ||
(sfp = fdopen(fd, "w+")) == NULL) {
+ int saved_errno = errno;
if (fd != -1) {
unlink(sfn);
close(fd);
}
- err(1, "could not open temporary file");
+ errc(1, saved_errno, "could not open temporary file");
}
for (i = 0; i < 4096 * THREAD_COUNT; i++)