diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2020-12-09 18:46:22 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2020-12-09 18:46:22 +0000 |
commit | ea189862e2be9ebf35da6174b1ae0083a22cc9ee (patch) | |
tree | 80324d68df13dfc519243118567df92a8e4e333a /src/libposixplz/mkptemp.c | |
parent | ef7aef6ba0d90174e9079944eaf3010de3555cc0 (diff) | |
download | skalibs-ea189862e2be9ebf35da6174b1ae0083a22cc9ee.tar.xz |
Add mkptemp2()
Diffstat (limited to 'src/libposixplz/mkptemp.c')
-rw-r--r-- | src/libposixplz/mkptemp.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/libposixplz/mkptemp.c b/src/libposixplz/mkptemp.c index 64ddb5c..2c3e817 100644 --- a/src/libposixplz/mkptemp.c +++ b/src/libposixplz/mkptemp.c @@ -1,22 +1,8 @@ /* ISC license. */ -#include <sys/stat.h> - -#include <skalibs/djbunix.h> #include <skalibs/posixplz.h> -static int f (char const *fn, mode_t mode, void *data) -{ - mode_t m = umask(0) ; - int r = mkfifo(fn, mode) ; - umask(m) ; - if (r == -1) return -1 ; - r = open_readb(fn) ; - if (r == -1) unlink_void(fn) ; - return r ; -} - int mkptemp (char *s) { - return mkfiletemp(s, &f, 0600, 0) ; + return mkptemp2(s, 0) ; } |