summaryrefslogtreecommitdiff
path: root/usr.bin/sort/sort.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2015-10-18 17:02:04 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2015-10-18 17:02:04 +0000
commitf45b2cbff580e19c2234e12ecc633360ca6696b3 (patch)
tree9007ad746cc4aa080335f5d8118b7075d1c3f4a4 /usr.bin/sort/sort.c
parentb130d48e5fc6753955d1c715b45dd48bb52f317c (diff)
Do not warn for sort -o if we can't chown the output temporary file
to match the owner of the output file.
Diffstat (limited to 'usr.bin/sort/sort.c')
-rw-r--r--usr.bin/sort/sort.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c
index fe11144874f..9b61cbe74fe 100644
--- a/usr.bin/sort/sort.c
+++ b/usr.bin/sort/sort.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sort.c,v 1.83 2015/10/17 14:33:01 tim Exp $ */
+/* $OpenBSD: sort.c,v 1.84 2015/10/18 17:02:03 millert Exp $ */
/*-
* Copyright (C) 2009 Gabor Kovesdan <gabor@FreeBSD.org>
@@ -1107,12 +1107,10 @@ main(int argc, char *argv[])
sort_asprintf(&outfile, "%s.XXXXXXXXXX",
real_outfile);
if ((fd = mkstemp(outfile)) == -1)
- err(2, "mkstemp: %s", outfile);
- if (fchown(fd, sb.st_uid, sb.st_gid) == -1)
- warn("unable to set ownership of %s",
- outfile);
+ err(2, "%s", outfile);
+ (void)fchown(fd, sb.st_uid, sb.st_gid);
if (fchmod(fd, sb.st_mode & ACCESSPERMS) == -1)
- err(2, "fchmod: %s", outfile);
+ err(2, "%s", outfile);
close(fd);
tmp_file_atexit(outfile);
break;