diff options
| author | Pierre Joye <pajoye@php.net> | 2009-09-06 22:01:18 +0000 |
|---|---|---|
| committer | Pierre Joye <pajoye@php.net> | 2009-09-06 22:01:18 +0000 |
| commit | 3e359ee5b486694bcae39b9283b6245e707527c3 (patch) | |
| tree | 6d1200e581ccd22cdbb5be2a66724ce6dd8c0df7 | |
| parent | b4ee727353fcd4b8c0bf7011f8c0cfc94e23316d (diff) | |
| download | php-git-3e359ee5b486694bcae39b9283b6245e707527c3.tar.gz | |
- fix #40013, php_uname() doesnt return nodename (MFH)
| -rw-r--r-- | ext/standard/info.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ext/standard/info.c b/ext/standard/info.c index 393d499c11..dc03a4805e 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -527,6 +527,30 @@ PHPAPI char *php_get_uname(char mode) 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') { @@ -543,6 +567,7 @@ PHPAPI char *php_get_uname(char mode) buf.machine); php_uname = tmp_uname; } +#endif /* NETWARE */ } #else php_uname = PHP_UNAME; |
