uname() on solaris may return a positive value on success, not just 0

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37767 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Riccardo Mottola 2014-03-25 23:06:00 +00:00
parent ee7c2c64a4
commit f5326c8db1
2 changed files with 7 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2014-03-26 Riccardo Mottola <rm@gnu.org>
* Source/NSProcessInfo.m (determineOperatingSystem):
uname() on solaris may return a positive value on success, not just 0
2014-03-25 Fred Kiefer <fredkiefer@gmx.de>
* Tools/NSOperation.m: ([_finish]) fix logic of 'executing' flag.

View file

@ -1,5 +1,5 @@
/** Implementation for NSProcessInfo for GNUStep
Copyright (C) 1995-2001 Free Software Foundation, Inc.
Copyright (C) 1995-2014 Free Software Foundation, Inc.
Written by: Georg Tuparev <Tuparev@EMBL-Heidelberg.de>
Heidelberg, Germany
@ -1122,7 +1122,7 @@ static void determineOperatingSystem()
* That's good if the binary is running on a system other than
* the one it was built for (rare, but can happen).
*/
if (uname(&uts) == 0)
if (!(uname(&uts) < 0))
{
os = [NSString stringWithCString: uts.sysname encoding: [NSString defaultCStringEncoding]];
os = [os lowercaseString];