diff options
Diffstat (limited to 'src/regress/lib/libc/stdio_threading')
6 files changed, 11 insertions, 5 deletions
diff --git a/src/regress/lib/libc/stdio_threading/fgetln/fgetln_test.c b/src/regress/lib/libc/stdio_threading/fgetln/fgetln_test.c index 0c815838d0..76d154bb2a 100755 --- a/src/regress/lib/libc/stdio_threading/fgetln/fgetln_test.c +++ b/src/regress/lib/libc/stdio_threading/fgetln/fgetln_test.c | |||
| @@ -49,11 +49,12 @@ main(void) | |||
| 49 | strlcpy(sfn, "/tmp/barnacles.XXXXXXXX", sizeof(sfn)); | 49 | strlcpy(sfn, "/tmp/barnacles.XXXXXXXX", sizeof(sfn)); |
| 50 | if ((fd = mkstemp(sfn)) == -1 || | 50 | if ((fd = mkstemp(sfn)) == -1 || |
| 51 | (sfp = fdopen(fd, "w+")) == NULL) { | 51 | (sfp = fdopen(fd, "w+")) == NULL) { |
| 52 | int saved_errno = errno; | ||
| 52 | if (fd != -1) { | 53 | if (fd != -1) { |
| 53 | unlink(sfn); | 54 | unlink(sfn); |
| 54 | close(fd); | 55 | close(fd); |
| 55 | } | 56 | } |
| 56 | err(1, "could not open temporary file"); | 57 | errc(1, saved_errno, "could not open temporary file"); |
| 57 | } | 58 | } |
| 58 | 59 | ||
| 59 | for (i = 0; i < 4096 * THREAD_COUNT; i++) | 60 | for (i = 0; i < 4096 * THREAD_COUNT; i++) |
diff --git a/src/regress/lib/libc/stdio_threading/fgets/fgets_test.c b/src/regress/lib/libc/stdio_threading/fgets/fgets_test.c index c53abbc06b..7c5008e2ad 100755 --- a/src/regress/lib/libc/stdio_threading/fgets/fgets_test.c +++ b/src/regress/lib/libc/stdio_threading/fgets/fgets_test.c | |||
| @@ -48,11 +48,12 @@ main(void) | |||
| 48 | strlcpy(sfn, "/tmp/barnacles.XXXXXXXX", sizeof(sfn)); | 48 | strlcpy(sfn, "/tmp/barnacles.XXXXXXXX", sizeof(sfn)); |
| 49 | if ((fd = mkstemp(sfn)) == -1 || | 49 | if ((fd = mkstemp(sfn)) == -1 || |
| 50 | (sfp = fdopen(fd, "w+")) == NULL) { | 50 | (sfp = fdopen(fd, "w+")) == NULL) { |
| 51 | int saved_errno = errno; | ||
| 51 | if (fd != -1) { | 52 | if (fd != -1) { |
| 52 | unlink(sfn); | 53 | unlink(sfn); |
| 53 | close(fd); | 54 | close(fd); |
| 54 | } | 55 | } |
| 55 | err(1, "could not open temporary file"); | 56 | errc(1, saved_errno, "could not open temporary file"); |
| 56 | } | 57 | } |
| 57 | 58 | ||
| 58 | for (i = 0; i < 4096 * THREAD_COUNT; i++) | 59 | for (i = 0; i < 4096 * THREAD_COUNT; i++) |
diff --git a/src/regress/lib/libc/stdio_threading/fputs/fputs_test.c b/src/regress/lib/libc/stdio_threading/fputs/fputs_test.c index 90b6179fd5..93d0f0b6c7 100755 --- a/src/regress/lib/libc/stdio_threading/fputs/fputs_test.c +++ b/src/regress/lib/libc/stdio_threading/fputs/fputs_test.c | |||
| @@ -46,11 +46,12 @@ main(void) | |||
| 46 | strlcpy(sfn, "/tmp/barnacles.XXXXXXXX", sizeof(sfn)); | 46 | strlcpy(sfn, "/tmp/barnacles.XXXXXXXX", sizeof(sfn)); |
| 47 | if ((fd = mkstemp(sfn)) == -1 || | 47 | if ((fd = mkstemp(sfn)) == -1 || |
| 48 | (sfp = fdopen(fd, "w+")) == NULL) { | 48 | (sfp = fdopen(fd, "w+")) == NULL) { |
| 49 | int saved_errno = errno; | ||
| 49 | if (fd != -1) { | 50 | if (fd != -1) { |
| 50 | unlink(sfn); | 51 | unlink(sfn); |
| 51 | close(fd); | 52 | close(fd); |
| 52 | } | 53 | } |
| 53 | err(1, "could not open temporary file"); | 54 | errc(1, saved_errno, "could not open temporary file"); |
| 54 | } | 55 | } |
| 55 | 56 | ||
| 56 | run_threads(fputs_thread, sfp); | 57 | run_threads(fputs_thread, sfp); |
diff --git a/src/regress/lib/libc/stdio_threading/fread/fread_test.c b/src/regress/lib/libc/stdio_threading/fread/fread_test.c index c45a64d14e..6bd734b470 100755 --- a/src/regress/lib/libc/stdio_threading/fread/fread_test.c +++ b/src/regress/lib/libc/stdio_threading/fread/fread_test.c | |||
| @@ -50,11 +50,12 @@ main(void) | |||
| 50 | strlcpy(sfn, "/tmp/barnacles.XXXXXXXX", sizeof(sfn)); | 50 | strlcpy(sfn, "/tmp/barnacles.XXXXXXXX", sizeof(sfn)); |
| 51 | if ((fd = mkstemp(sfn)) == -1 || | 51 | if ((fd = mkstemp(sfn)) == -1 || |
| 52 | (sfp = fdopen(fd, "w+")) == NULL) { | 52 | (sfp = fdopen(fd, "w+")) == NULL) { |
| 53 | int saved_errno = errno; | ||
| 53 | if (fd != -1) { | 54 | if (fd != -1) { |
| 54 | unlink(sfn); | 55 | unlink(sfn); |
| 55 | close(fd); | 56 | close(fd); |
| 56 | } | 57 | } |
| 57 | err(1, "could not open temporary file"); | 58 | errc(1, saved_errno, "could not open temporary file"); |
| 58 | } | 59 | } |
| 59 | 60 | ||
| 60 | for (i = 0; i < 4096 * THREAD_COUNT; i++) | 61 | for (i = 0; i < 4096 * THREAD_COUNT; i++) |
diff --git a/src/regress/lib/libc/stdio_threading/fwrite/fwrite_test.c b/src/regress/lib/libc/stdio_threading/fwrite/fwrite_test.c index 621c5cb6e8..86c450cbc9 100755 --- a/src/regress/lib/libc/stdio_threading/fwrite/fwrite_test.c +++ b/src/regress/lib/libc/stdio_threading/fwrite/fwrite_test.c | |||
| @@ -46,11 +46,12 @@ main(void) | |||
| 46 | strlcpy(sfn, "/tmp/barnacles.XXXXXXXX", sizeof(sfn)); | 46 | strlcpy(sfn, "/tmp/barnacles.XXXXXXXX", sizeof(sfn)); |
| 47 | if ((fd = mkstemp(sfn)) == -1 || | 47 | if ((fd = mkstemp(sfn)) == -1 || |
| 48 | (sfp = fdopen(fd, "w+")) == NULL) { | 48 | (sfp = fdopen(fd, "w+")) == NULL) { |
| 49 | int saved_errno = errno; | ||
| 49 | if (fd != -1) { | 50 | if (fd != -1) { |
| 50 | unlink(sfn); | 51 | unlink(sfn); |
| 51 | close(fd); | 52 | close(fd); |
| 52 | } | 53 | } |
| 53 | err(1, "could not open temporary file"); | 54 | errc(1, saved_errno, "could not open temporary file"); |
| 54 | } | 55 | } |
| 55 | 56 | ||
| 56 | run_threads(fwrite_thread, sfp); | 57 | run_threads(fwrite_thread, sfp); |
diff --git a/src/regress/lib/libc/stdio_threading/include/local.h b/src/regress/lib/libc/stdio_threading/include/local.h index 8d0e628cf6..7a7822a452 100644 --- a/src/regress/lib/libc/stdio_threading/include/local.h +++ b/src/regress/lib/libc/stdio_threading/include/local.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | */ | 15 | */ |
| 16 | 16 | ||
| 17 | #include <err.h> | 17 | #include <err.h> |
| 18 | #include <errno.h> | ||
| 18 | #include <stdio.h> | 19 | #include <stdio.h> |
| 19 | #include <stdlib.h> | 20 | #include <stdlib.h> |
| 20 | #include <string.h> | 21 | #include <string.h> |
