Przeglądaj źródła

* Fix uname checking on NetBSD and OpenBSD

Bryan Drewery 17 lat temu
rodzic
commit
31a96dc40a
2 zmienionych plików z 6 dodań i 3 usunięć
  1. 1 0
      doc/UPDATES
  2. 5 3
      src/shell.c

+ 1 - 0
doc/UPDATES

@@ -1,4 +1,5 @@
 * Binary pass prompt has been changed to be more clear.
+* Fix uname checking on NetBSD and OpenBSD
 
 1.2.16 - http://wraith.botpack.net/milestone/1.2.16
 * Add 'set altchars' so that alternative characters used for nicks can be changed. (fixes #418)

+ 5 - 3
src/shell.c

@@ -832,11 +832,13 @@ char *my_uname()
       vers_n = "";
     } else {
       unix_n = un.nodename;
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
       vers_n = un.release;
-#else /* __linux__ */
+#elif defined(__linux__)
       vers_n = un.version;
-#endif /* __FreeBSD__ */
+#else
+# error "Don't know how to handle uname for this system!"
+#endif
     }
     simple_snprintf(os_uname, sizeof os_uname, "%s %s", unix_n, vers_n);
   }