diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2021-04-09 23:55:43 -0400 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2023-05-03 23:11:34 -0400 |
commit | 2695a8b2e21ab7c4c16b7dddb6fff53a4797b98c (patch) | |
tree | 90605c43039fc0d6bbe318c6f545868b3db3b0b9 /src/t | |
parent | d7bbd70bd10e429c18df273dd060006a69a91d1e (diff) | |
download | lighttpd-git-2695a8b2e21ab7c4c16b7dddb6fff53a4797b98c.tar.gz |
[core] _WIN32 sys-unistd.h to wrap <unistd.h>
(selective implementations; not complete)
Diffstat (limited to 'src/t')
-rw-r--r-- | src/t/test_mod_indexfile.c | 10 | ||||
-rw-r--r-- | src/t/test_mod_ssi.c | 2 | ||||
-rw-r--r-- | src/t/test_mod_staticfile.c | 10 |
3 files changed, 7 insertions, 15 deletions
diff --git a/src/t/test_mod_indexfile.c b/src/t/test_mod_indexfile.c index 616fd280..f316916f 100644 --- a/src/t/test_mod_indexfile.c +++ b/src/t/test_mod_indexfile.c @@ -34,18 +34,14 @@ run_mod_indexfile_tryfiles (request_st * const r, const array * const indexfiles } } -#include <unistd.h> /* unlink() */ +#include "sys-unistd.h" /* unlink() */ +#include "fdevent.h" static void test_mod_indexfile_tryfiles (request_st * const r) { char fn[] = "/tmp/lighttpd_mod_indexfile.XXXXXX"; - #ifdef __COVERITY__ - /* POSIX-2008 requires mkstemp create file with 0600 perms */ - umask(0600); - #endif - /* coverity[secure_temp : FALSE] */ - int fd = mkstemp(fn); + int fd = fdevent_mkostemp(fn, 0); if (fd < 0) { perror("mkstemp()"); exit(1); diff --git a/src/t/test_mod_ssi.c b/src/t/test_mod_ssi.c index 2f2a5c49..085d041d 100644 --- a/src/t/test_mod_ssi.c +++ b/src/t/test_mod_ssi.c @@ -5,7 +5,7 @@ #include <assert.h> #include <stdlib.h> #include <stdio.h> -#include <unistd.h> +#include "sys-unistd.h" /* unlink() */ #include "mod_ssi.c" #include "fdlog.h" diff --git a/src/t/test_mod_staticfile.c b/src/t/test_mod_staticfile.c index 6fb260d5..1b95179f 100644 --- a/src/t/test_mod_staticfile.c +++ b/src/t/test_mod_staticfile.c @@ -365,18 +365,14 @@ test_mod_staticfile_process (request_st * const r, plugin_config * const pconf) array_free(a); } -#include <unistd.h> /* unlink() */ +#include "sys-unistd.h" /* unlink() */ +#include "fdevent.h" void test_mod_staticfile (void); void test_mod_staticfile (void) { char fn[] = "/tmp/lighttpd_mod_staticfile.XXXXXX"; - #ifdef __COVERITY__ - /* POSIX-2008 requires mkstemp create file with 0600 perms */ - umask(0600); - #endif - /* coverity[secure_temp : FALSE] */ - int fd = mkstemp(fn); + int fd = fdevent_mkostemp(fn, 0); if (fd < 0) { perror("mkstemp()"); exit(1); |