summaryrefslogtreecommitdiff
path: root/lib/mkstemp-safer.c
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-11-16 16:09:42 -0700
committerEric Blake <ebb9@byu.net>2009-12-05 14:42:50 -0700
commitf2fdd542de54c78c89fd8b50b76921cf31fdb518 (patch)
tree58174c849059d32ff9f68d4cda470803451b6d5d /lib/mkstemp-safer.c
parent14449a1dacca44c4f933d5fc207c7fa56e6c0fb7 (diff)
downloadgnulib-f2fdd542de54c78c89fd8b50b76921cf31fdb518.tar.gz
stdlib-safer: preserve cloexec flag for mkostemp[s]
mkostemp_safer(templ,O_CLOEXEC) did not always guarantee cloexec. * lib/mkstemp-safer.c (mkostemp_safer, mkostemps_safer): Use new fd_safer_flag. Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'lib/mkstemp-safer.c')
-rw-r--r--lib/mkstemp-safer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mkstemp-safer.c b/lib/mkstemp-safer.c
index 95d315b030..ee242f3f10 100644
--- a/lib/mkstemp-safer.c
+++ b/lib/mkstemp-safer.c
@@ -39,7 +39,7 @@ mkstemp_safer (char *templ)
int
mkostemp_safer (char *templ, int flags)
{
- return fd_safer (mkostemp (templ, flags));
+ return fd_safer_flag (mkostemp (templ, flags), flags);
}
#endif
@@ -49,7 +49,7 @@ mkostemp_safer (char *templ, int flags)
int
mkostemps_safer (char *templ, int suffixlen, int flags)
{
- return fd_safer (mkostemps (templ, suffixlen, flags));
+ return fd_safer_flag (mkostemps (templ, suffixlen, flags), flags);
}
#endif