There's some problem with uname () - some systems like Solaris or Digital

1999-05-07  Martin Baulig  <martin@home-of-linux.org>

	* server.c (main): There's some problem with uname () - some systems
	like Solaris or Digital Unix return a nonnegative value on success,
	some others like Linux return 0. Since all known systems seem to return
	a negative value on failure, we simply check whether the return value is
	not negative here.
This commit is contained in:
Martin Baulig
1999-05-07 22:58:21 +00:00
committed by Martin Baulig
parent 217a1e92c6
commit 74d11991ab
3 changed files with 10 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
Makefile.in
Makefile
libgtop_daemon
libgtop_server
server.conf
.libs
.deps

View File

@@ -1,3 +1,11 @@
1999-05-07 Martin Baulig <martin@home-of-linux.org>
* server.c (main): There's some problem with uname () - some systems
like Solaris or Digital Unix return a nonnegative value on success,
some others like Linux return 0. Since all known systems seem to return
a negative value on failure, we simply check whether the return value is
not negative here.
1999-02-19 Martin Baulig <martin@home-of-linux.org>
* Makefile.am (LIBGTOP_COMPILE_SYSTEM): Hardcoded system name.

View File

@@ -68,7 +68,7 @@ main(int argc, char *argv[])
uid = getuid (); euid = geteuid ();
gid = getgid (); egid = getegid ();
if (uname (&uts)) _exit (1);
if (uname (&uts) < 0) _exit (1);
if (strcmp (uts.sysname, LIBGTOP_COMPILE_SYSTEM) ||
strcmp (uts.release, LIBGTOP_COMPILE_RELEASE) ||