Fix incorrect uname usage.

The POSIX function uname() can return any non-negative value for success.
- Example: Solaris 10 returns 1 on success.
See: http://pubs.opengroup.org/onlinepubs/009695399/functions/uname.html

Change-Id: Ic3d51f94a31d8b562b28a2d09df3d31b04c77dc8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Chris Stylianou 2013-06-21 15:02:39 +01:00 committed by The Qt Project
parent e02c6dd1d3
commit e97c37a37a

View File

@ -1037,7 +1037,7 @@ void QMakeEvaluator::loadDefaults()
# endif
#elif defined(Q_OS_UNIX)
struct utsname name;
if (!uname(&name)) {
if (uname(&name) != -1) {
vars[ProKey("QMAKE_HOST.os")] << ProString(name.sysname);
vars[ProKey("QMAKE_HOST.name")] << ProString(QString::fromLocal8Bit(name.nodename));
vars[ProKey("QMAKE_HOST.version")] << ProString(name.release);