summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-10-20 15:33:21 +0000
committerpeter <peter@FreeBSD.org>1998-10-20 15:33:21 +0000
commitd237d225342ff374e09aa38ba5891ea25e3ffa5f (patch)
tree721f3a42782b3811187589aaadd390d4681197a9 /lib
parent6bb510cabe2cd49356f8a6aa3c280f8a115ac657 (diff)
downloadFreeBSD-src-d237d225342ff374e09aa38ba5891ea25e3ffa5f.zip
FreeBSD-src-d237d225342ff374e09aa38ba5891ea25e3ffa5f.tar.gz
Revert last change. mkstemp() wasn't to blame, it's nvi. However,
mkstemp() is not behaving as documented.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdio/mktemp.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/lib/libc/stdio/mktemp.c b/lib/libc/stdio/mktemp.c
index fd43c45..c2da533 100644
--- a/lib/libc/stdio/mktemp.c
+++ b/lib/libc/stdio/mktemp.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
#endif
static const char rcsid[] =
- "$Id: mktemp.c,v 1.10 1998/04/14 07:25:05 peter Exp $";
+ "$Id: mktemp.c,v 1.11 1998/10/20 12:36:36 peter Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -56,39 +56,23 @@ int
mkstemp(path)
char *path;
{
- int fd, rval;
- mode_t oldumask;
+ int fd;
- oldumask = umask(077);
- rval = (_gettemp(path, &fd, 0) ? fd : -1);
- umask(oldumask);
- return rval;
+ return (_gettemp(path, &fd, 0) ? fd : -1);
}
char *
mkdtemp(path)
char *path;
{
- char *rval;
- mode_t oldumask;
-
- oldumask = umask(077);
- rval = (_gettemp(path, (int *)NULL, 1) ? path : (char *)NULL);
- umask(oldumask);
- return rval;
+ return(_gettemp(path, (int *)NULL, 1) ? path : (char *)NULL);
}
char *
_mktemp(path)
char *path;
{
- char *rval;
- mode_t oldumask;
-
- oldumask = umask(077);
- rval = (_gettemp(path, (int *)NULL, 0) ? path : (char *)NULL);
- umask(oldumask);
- return rval;
+ return(_gettemp(path, (int *)NULL, 0) ? path : (char *)NULL);
}
#ifdef UNSAFE_WARN
OpenPOWER on IntegriCloud