pajoye          Wed Mar  5 21:18:26 2008 UTC

  Modified files:              
    /php-src/ext/standard       info.c 
  Log:
  - MFB: #40013, php_uname() does not return nodename on Netware 
    (Guenter Knauf)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/info.c?r1=1.286&r2=1.287&diff_format=u
Index: php-src/ext/standard/info.c
diff -u php-src/ext/standard/info.c:1.286 php-src/ext/standard/info.c:1.287
--- php-src/ext/standard/info.c:1.286   Sun Mar  2 15:36:24 2008
+++ php-src/ext/standard/info.c Wed Mar  5 21:18:26 2008
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: info.c,v 1.286 2008/03/02 15:36:24 iliaa Exp $ */
+/* $Id: info.c,v 1.287 2008/03/05 21:18:26 pajoye Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -425,6 +425,30 @@
        if (uname((struct utsname *)&buf) == -1) {
                php_uname = PHP_UNAME;
        } else {
+#ifdef NETWARE
+               if (mode == 's') {
+                       php_uname = buf.sysname;
+               } else if (mode == 'r') {
+                       snprintf(tmp_uname, sizeof(tmp_uname), "%d.%d.%d", 
+                                        buf.netware_major, buf.netware_minor, 
buf.netware_revision);
+                       php_uname = tmp_uname;
+               } else if (mode == 'n') {
+                       php_uname = buf.servername;
+               } else if (mode == 'v') {
+                       snprintf(tmp_uname, sizeof(tmp_uname), "libc-%d.%d.%d 
#%d",
+                                        buf.libmajor, buf.libminor, 
buf.librevision, buf.libthreshold);
+                       php_uname = tmp_uname;
+               } else if (mode == 'm') {
+                       php_uname = buf.machine;
+               } else { /* assume mode == 'a' */
+                       snprintf(tmp_uname, sizeof(tmp_uname), "%s %s %d.%d.%d 
libc-%d.%d.%d #%d %s",
+                                        buf.sysname, buf.servername,
+                                        buf.netware_major, buf.netware_minor, 
buf.netware_revision,
+                                        buf.libmajor, buf.libminor, 
buf.librevision, buf.libthreshold,
+                                        buf.machine);
+                       php_uname = tmp_uname;
+               }
+#else
                if (mode == 's') {
                        php_uname = buf.sysname;
                } else if (mode == 'r') {
@@ -441,6 +465,7 @@
                                         buf.machine);
                        php_uname = tmp_uname;
                }
+#endif /* NETWARE */
        }
 #else
        php_uname = PHP_UNAME;



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to