lobase

Linux port of OpenBSDs userland.
Log | Files | Refs | README

commit 251af6bed4f12edfbf39656a5577a2f46cf94cae
parent aaa0432098a4963ede730467321370e8aa38e8e0
Author: Duncaen <mail@duncano.de>
Date:   Fri, 19 May 2017 18:00:17 +0200

usr.bin/uname: update to OPENBSD_6_1

Diffstat:
usr.bin/uname/uname.c | 19++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)

diff --git a/usr.bin/uname/uname.c b/usr.bin/uname/uname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uname.c,v 1.17 2015/12/24 15:01:24 tb Exp $ */ +/* $OpenBSD: uname.c,v 1.19 2016/10/28 07:22:59 schwarze Exp $ */ /* * Copyright (c) 1994 Winning Strategies, Inc. @@ -35,7 +35,6 @@ #include <sys/utsname.h> #include <err.h> -#include <locale.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -44,7 +43,7 @@ #define MACHINE_ARCH "unknown" #endif -static void usage(void); +static void __dead usage(void); #define PRINT_SYSNAME 0x01 #define PRINT_NODENAME 0x02 @@ -62,8 +61,6 @@ main(int argc, char *argv[]) int space = 0; int print_mask = 0; - setlocale(LC_ALL, ""); - if (pledge("stdio", NULL) == -1) err(1, "pledge"); @@ -92,20 +89,16 @@ main(int argc, char *argv[]) break; default: usage(); - /* NOTREACHED */ } } - if (optind != argc) { + if (optind != argc) usage(); - /* NOTREACHED */ - } - if (!print_mask) { + if (!print_mask) print_mask = PRINT_SYSNAME; - } - if (uname(&u)) + if (uname(&u) == -1) err(1, NULL); if (print_mask & PRINT_SYSNAME) { @@ -147,7 +140,7 @@ main(int argc, char *argv[]) return 0; } -static void +static void __dead usage(void) { fprintf(stderr, "usage: uname [-amnprsv]\n");