Bug 1314904 - uname() on success can return non-negative value (not just 0). r=bsmedberg

This commit is contained in:
Petr Sumbera 2016-11-03 03:23:46 -07:00
parent 0024b052cb
commit 433839eccf
2 changed files with 2 additions and 3 deletions

View File

@ -105,8 +105,7 @@ nsUserInfo::GetDomain(char * *aDomain)
struct utsname buf;
char *domainname = nullptr;
// is this portable? that is a POSIX compliant call, but I need to check
if (uname(&buf)) {
if (uname(&buf) < 0) {
return rv;
}

View File

@ -135,7 +135,7 @@ GfxInfo::GetData()
// only useful for Linux kernel version check for FGLRX driver.
// assumes X client == X server, which is sad.
struct utsname unameobj;
if (!uname(&unameobj))
if (uname(&unameobj) >= 0)
{
mOS.Assign(unameobj.sysname);
mOSRelease.Assign(unameobj.release);