make uname() more likely to work on solaris

(linux says 0 is success, solaris says 1 is success)


svn:r1322
This commit is contained in:
Roger Dingledine 2004-03-20 21:22:16 +00:00
parent 49a221500d
commit d10fcc89ec

View File

@ -989,7 +989,8 @@ get_uname(void)
#endif
if (!uname_result_is_set) {
#ifdef HAVE_UNAME
if (!uname((&u))) {
if (uname(&u) != -1) {
/* (linux says 0 is success, solaris says 1 is success) */
snprintf(uname_result, 255, "%s %s %s",
u.sysname, u.nodename, u.machine);
uname_result[255] = '\0';