From 0c493a9e58dc0e27879063fb71caa08e35848dfe Mon Sep 17 00:00:00 2001 From: Gleydson Soares Date: Mon, 10 Oct 2016 02:23:55 +0000 Subject: calls to uname(3) should be checked against non-negative value upon successful and -1 on failure (as per POSIX). No functional change, just improves portability. OK millert@ schwarze@ guenther@ --- usr.bin/uname/uname.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.bin/uname/uname.c') diff --git a/usr.bin/uname/uname.c b/usr.bin/uname/uname.c index 97d84a65412..d15c7c7fe2f 100644 --- 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.18 2016/10/10 02:23:54 gsoares Exp $ */ /* * Copyright (c) 1994 Winning Strategies, Inc. @@ -101,7 +101,7 @@ main(int argc, char *argv[]) print_mask = PRINT_SYSNAME; } - if (uname(&u)) + if (uname(&u) == -1) err(1, NULL); if (print_mask & PRINT_SYSNAME) { -- cgit v1.2.3