summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2011-01-10 20:59:43 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2011-01-10 20:59:43 +0000
commit579bf3acdf41bffca91b45450743135061f19d88 (patch)
tree99c42ced60b77b5cf0685c2cd4a3aa901c8180c9
parentcb5ac835f136e12778cf5930568c918d89ab16ee (diff)
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 */