diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2020-12-10 10:04:57 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2020-12-10 10:04:57 +0000 |
commit | ae33cbb87a1109b718a535c7587433662dc98071 (patch) | |
tree | 7148dd200a4765232f94a6f5680a7cf558debd8c /src/libs6/ftrig1_make.c | |
parent | dd4afee4a8ea8c44126c44b31c6f1a36582d0964 (diff) | |
download | s6-ae33cbb87a1109b718a535c7587433662dc98071.tar.xz |
Use mkptemp2
Diffstat (limited to 'src/libs6/ftrig1_make.c')
-rw-r--r-- | src/libs6/ftrig1_make.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libs6/ftrig1_make.c b/src/libs6/ftrig1_make.c index 6a6ff11..04c8c73 100644 --- a/src/libs6/ftrig1_make.c +++ b/src/libs6/ftrig1_make.c @@ -2,6 +2,7 @@ #include <string.h> #include <stdio.h> +#include <fcntl.h> #include <skalibs/posixplz.h> #include <skalibs/tai.h> @@ -22,9 +23,8 @@ int ftrig1_make (ftrig1_t *f, char const *path) tmp[pathlen + 2 + FTRIG1_PREFIXLEN] = ':' ; if (!timestamp(tmp + pathlen + 3 + FTRIG1_PREFIXLEN)) return 0 ; memcpy(tmp + pathlen + FTRIG1_PREFIXLEN + 28, ":XXXXXX", 8) ; - ff.fd = mkptemp(tmp) ; + ff.fd = mkptemp2(tmp, O_NONBLOCK|O_CLOEXEC) ; if (ff.fd == -1) return 0 ; - if (ndelay_on(ff.fd) == -1) goto err1 ; ff.fdw = open_write(tmp) ; if (ff.fdw == -1) goto err1 ; if (!stralloc_ready(&ff.name, pathlen + FTRIG1_PREFIXLEN + 36)) goto err2 ; |