summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2011-01-10 20:59:42 +0000
committerderaadt <deraadt@openbsd.org>2011-01-10 20:59:42 +0000
commit04e9db6c1c726e9451f32d099287badc12afd8cc (patch)
tree3de89494ce177bab76f7b5a016cdea8254ae476c
parentmkdtemp() is present in POSIX 1003.1-2008 (diff)
downloadwireguard-openbsd-04e9db6c1c726e9451f32d099287badc12afd8cc.tar.xz
wireguard-openbsd-04e9db6c1c726e9451f32d099287badc12afd8cc.zip
delete embarrasingly horrid use of mktemp() brought in from upstream
ok millert
-rw-r--r--usr.bin/file/compress.c12
-rw-r--r--usr.bin/file/config.h3
2 files changed, 2 insertions, 13 deletions
diff --git a/usr.bin/file/compress.c b/usr.bin/file/compress.c
index a0e04f9ac47..5f576d45f18 100644
--- a/usr.bin/file/compress.c
+++ b/usr.bin/file/compress.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: compress.c,v 1.14 2009/10/27 23:59:37 deraadt Exp $ */
+/* $OpenBSD: compress.c,v 1.15 2011/01/10 20:59:42 deraadt Exp $ */
/*
* Copyright (c) Ian F. Darwin 1986-1995.
* Software written by Ian F. Darwin and others;
@@ -235,20 +235,10 @@ file_pipe2file(struct magic_set *ms, int fd, const void *startbuf,
int r, tfd;
(void)strlcpy(buf, "/tmp/file.XXXXXX", sizeof buf);
-#ifndef HAVE_MKSTEMP
- {
- char *ptr = mktemp(buf);
- tfd = open(ptr, O_RDWR|O_TRUNC|O_EXCL|O_CREAT, 0600);
- r = errno;
- (void)unlink(ptr);
- errno = r;
- }
-#else
tfd = mkstemp(buf);
r = errno;
(void)unlink(buf);
errno = r;
-#endif
if (tfd == -1) {
file_error(ms, errno,
"cannot create temporary file for pipe copy");
diff --git a/usr.bin/file/config.h b/usr.bin/file/config.h
index 09251bd081c..a3b56dc19e1 100644
--- a/usr.bin/file/config.h
+++ b/usr.bin/file/config.h
@@ -4,7 +4,7 @@
* but can still carefully import stuff from Christos' version.
*
* This file is in the public domain. Original Author Ian F. Darwin.
- * $OpenBSD: config.h,v 1.5 2009/06/13 11:14:19 miod Exp $
+ * $OpenBSD: config.h,v 1.6 2011/01/10 20:59:42 deraadt Exp $
*/
/* header file issues. */
@@ -29,7 +29,6 @@
/* Library issues */
#define HAVE_GETOPT_LONG 1 /* in-tree as of 3.2 */
-#define HAVE_MKSTEMP 1
#define HAVE_ST_RDEV 1
/* ELF support */