aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2017-05-19 18:21:06 +0200
committerDuncaen <mail@duncano.de>2017-05-19 18:41:03 +0200
commitb3fb7ce077d38f802225feeba316a4528bc2e646 (patch)
tree2a0a0881f173e2a26702bc0adca19cbb73fc2e68
parent47b16dc709eb183d85439e732e381bcdfea3daa2 (diff)
downloadlobase-b3fb7ce077d38f802225feeba316a4528bc2e646.tar.gz
usr.bin/sort: update to OPENBSD_6_1
-rw-r--r--usr.bin/sort/coll.c10
-rw-r--r--usr.bin/sort/file.c4
-rw-r--r--usr.bin/sort/sort.114
-rw-r--r--usr.bin/sort/sort.c9
-rw-r--r--usr.bin/sort/test.c1
5 files changed, 22 insertions, 16 deletions
diff --git a/usr.bin/sort/coll.c b/usr.bin/sort/coll.c
index 08fefa9..78272d6 100644
--- a/usr.bin/sort/coll.c
+++ b/usr.bin/sort/coll.c
@@ -782,7 +782,7 @@ cmpsuffix(unsigned char si1, unsigned char si2)
*/
static int
numcoll_impl(struct key_value *kv1, struct key_value *kv2,
- size_t offset __UNUSED, bool use_suffix)
+ size_t offset __unused, bool use_suffix)
{
struct bwstring *s1, *s2;
wchar_t sfrac1[MAX_NUM_SIZE + 1], sfrac2[MAX_NUM_SIZE + 1];
@@ -955,7 +955,7 @@ hnumcoll(struct key_value *kv1, struct key_value *kv2, size_t offset)
*/
static int
randomcoll(struct key_value *kv1, struct key_value *kv2,
- size_t offset __UNUSED)
+ size_t offset __unused)
{
struct bwstring *s1, *s2;
MD5_CTX ctx1, ctx2;
@@ -1008,7 +1008,7 @@ randomcoll(struct key_value *kv1, struct key_value *kv2,
*/
static int
versioncoll(struct key_value *kv1, struct key_value *kv2,
- size_t offset __UNUSED)
+ size_t offset __unused)
{
struct bwstring *s1, *s2;
@@ -1081,7 +1081,7 @@ cmp_nans(double d1, double d2)
*/
static int
gnumcoll(struct key_value *kv1, struct key_value *kv2,
- size_t offset __UNUSED)
+ size_t offset __unused)
{
double d1, d2;
int err1, err2;
@@ -1237,7 +1237,7 @@ gnumcoll(struct key_value *kv1, struct key_value *kv2,
* Implements month sort (-M).
*/
static int
-monthcoll(struct key_value *kv1, struct key_value *kv2, size_t offset __UNUSED)
+monthcoll(struct key_value *kv1, struct key_value *kv2, size_t offset __unused)
{
int val1, val2;
bool key1_read, key2_read;
diff --git a/usr.bin/sort/file.c b/usr.bin/sort/file.c
index d7cf004..a89f552 100644
--- a/usr.bin/sort/file.c
+++ b/usr.bin/sort/file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: file.c,v 1.20 2015/04/03 10:37:24 tobias Exp $ */
+/* $OpenBSD: file.c,v 1.21 2016/10/17 02:58:29 lteo Exp $ */
/*-
* Copyright (C) 2009 Gabor Kovesdan <gabor@FreeBSD.org>
@@ -50,7 +50,7 @@ unsigned long long available_free_memory = 1000000;
bool use_mmap;
-const char *tmpdir = "/var/tmp";
+const char *tmpdir = "/tmp";
const char *compress_program;
size_t max_open_files = 16;
diff --git a/usr.bin/sort/sort.1 b/usr.bin/sort/sort.1
index c1c9f21..d35b37e 100644
--- a/usr.bin/sort/sort.1
+++ b/usr.bin/sort/sort.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: sort.1,v 1.54 2015/04/05 14:20:22 millert Exp $
+.\" $OpenBSD: sort.1,v 1.56 2016/10/17 02:58:29 lteo Exp $
.\"
.\" Copyright (c) 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -32,7 +32,7 @@
.\"
.\" @(#)sort.1 8.1 (Berkeley) 6/6/93
.\"
-.Dd $Mdocdate: April 5 2015 $
+.Dd $Mdocdate: October 17 2016 $
.Dt SORT 1
.Os
.Sh NAME
@@ -52,7 +52,11 @@ The
.Nm
utility sorts text and binary files by lines.
A line is a record separated from the subsequent record by a
-newline (default) or NUL \'\\0\' character (-z option).
+newline (default) or NUL \'\\0\' character
+.Po
+.Fl z
+option
+.Pc .
A record can contain any printable or unprintable characters.
Comparisons are based on one or more sort keys extracted from
each line of input, and are performed lexicographically,
@@ -110,7 +114,7 @@ Store temporary files in the directory
The default path is the value of the environment variable
.Ev TMPDIR
or
-.Pa /var/tmp
+.Pa /tmp
if
.Ev TMPDIR
is not defined.
@@ -541,7 +545,7 @@ option.
.El
.Sh FILES
.Bl -tag -width Pa -compact
-.It Pa /var/tmp/.bsdsort.PID.*
+.It Pa /tmp/.bsdsort.PID.*
Temporary files.
.El
.Sh EXIT STATUS
diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c
index f78ce6f..782a2e3 100644
--- a/usr.bin/sort/sort.c
+++ b/usr.bin/sort/sort.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sort.c,v 1.86 2016/07/14 08:31:18 semarie Exp $ */
+/* $OpenBSD: sort.c,v 1.87 2017/01/04 15:30:58 millert Exp $ */
/*-
* Copyright (C) 2009 Gabor Kovesdan <gabor@FreeBSD.org>
@@ -402,7 +402,7 @@ invalid:
* Signal handler that clears the temporary files.
*/
static void
-sig_handler(int sig __UNUSED)
+sig_handler(int sig __unused)
{
clear_tmp_files();
_exit(2);
@@ -1231,7 +1231,10 @@ main(int argc, char *argv[])
struct file_list fl;
file_list_init(&fl, false);
- file_list_populate(&fl, argc, argv, true);
+ if (argc < 1)
+ file_list_add(&fl, "-", true);
+ else
+ file_list_populate(&fl, argc, argv, true);
merge_files(&fl, outfile);
file_list_clean(&fl);
}
diff --git a/usr.bin/sort/test.c b/usr.bin/sort/test.c
index e8642c9..e69de29 100644
--- a/usr.bin/sort/test.c
+++ b/usr.bin/sort/test.c
@@ -1 +0,0 @@
-#include <md5.h>