summaryrefslogtreecommitdiffstats
path: root/usr.bin/file/compress.c
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 /usr.bin/file/compress.c
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
Diffstat (limited to 'usr.bin/file/compress.c')
-rw-r--r--usr.bin/file/compress.c12
1 files changed, 1 insertions, 11 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");