diff options
author | Gleydson Soares <gsoares@cvs.openbsd.org> | 2016-10-10 02:23:55 +0000 |
---|---|---|
committer | Gleydson Soares <gsoares@cvs.openbsd.org> | 2016-10-10 02:23:55 +0000 |
commit | 0c493a9e58dc0e27879063fb71caa08e35848dfe (patch) | |
tree | a6ffd606d383ad7357d0d75fcb69605e0902d278 /usr.bin/uname/uname.c | |
parent | 0e13a6a885c413ddcdafa8fd899a1dc91c753c9a (diff) |
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@
Diffstat (limited to 'usr.bin/uname/uname.c')
-rw-r--r-- | usr.bin/uname/uname.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) { |