hyanantha               Fri Jan  3 09:37:43 2003 EDT

  Modified files:              
    /php4/ext/standard  exec.c file.c filestat.c html.c syslog.c 
  Log:
  Modified for NetWare.
  
  
Index: php4/ext/standard/exec.c
diff -u php4/ext/standard/exec.c:1.88 php4/ext/standard/exec.c:1.89
--- php4/ext/standard/exec.c:1.88       Tue Dec 31 11:07:38 2002
+++ php4/ext/standard/exec.c    Fri Jan  3 09:37:40 2003
@@ -15,7 +15,7 @@
    | Author: Rasmus Lerdorf                                               |
    +----------------------------------------------------------------------+
  */
-/* $Id: exec.c,v 1.88 2002/12/31 16:07:38 sebastian Exp $ */
+/* $Id: exec.c,v 1.89 2003/01/03 14:37:40 hyanantha Exp $ */
 
 #include <stdio.h>
 #include "php.h"
@@ -895,6 +895,18 @@
 
        child = pi.hProcess;
        CloseHandle(pi.hThread);
+
+#elif defined(NETWARE)
+
+       /* clean up all the descriptors */
+       for (i = 0; i < ndesc; i++) {
+               close(descriptors[i].childend);
+               close(descriptors[i].parentend);
+       }
+
+       php_error_docref(NULL TSRMLS_CC, E_WARNING, "fork not supported on NetWare");
+
+       goto exit_fail;
 
 #else
        /* the unix way */
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.285 php4/ext/standard/file.c:1.286
--- php4/ext/standard/file.c:1.285      Fri Jan  3 03:02:35 2003
+++ php4/ext/standard/file.c    Fri Jan  3 09:37:41 2003
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: file.c,v 1.285 2003/01/03 08:02:35 pollita Exp $ */
+/* $Id: file.c,v 1.286 2003/01/03 14:37:41 hyanantha Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -54,6 +54,7 @@
 #include "netware/param.h"
 #else
 #include <sys/param.h>
+#include <sys/select.h>
 #if defined(NETWARE) && defined(USE_WINSOCK)
 #include <novsock2.h>
 #else
@@ -1979,9 +1980,16 @@
        MAKE_LONG_ZVAL_INCREF(stat_rdev, -1); 
 #endif
        MAKE_LONG_ZVAL_INCREF(stat_size, stat_ssb.sb.st_size);
+#if defined(NETWARE) && defined(CLIB_STAT_PATCH)
+       MAKE_LONG_ZVAL_INCREF(stat_atime, stat_ssb.sb.st_atime.tv_sec);
+       MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_ssb.sb.st_mtime.tv_sec);
+       MAKE_LONG_ZVAL_INCREF(stat_ctime, stat_ssb.sb.st_ctime.tv_sec);
+#else
        MAKE_LONG_ZVAL_INCREF(stat_atime, stat_ssb.sb.st_atime);
        MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_ssb.sb.st_mtime);
        MAKE_LONG_ZVAL_INCREF(stat_ctime, stat_ssb.sb.st_ctime);
+#endif
+
 #ifdef HAVE_ST_BLKSIZE
        MAKE_LONG_ZVAL_INCREF(stat_blksize, stat_ssb.sb.st_blksize); 
 #else
Index: php4/ext/standard/filestat.c
diff -u php4/ext/standard/filestat.c:1.114 php4/ext/standard/filestat.c:1.115
--- php4/ext/standard/filestat.c:1.114  Tue Dec 31 11:07:40 2002
+++ php4/ext/standard/filestat.c        Fri Jan  3 09:37:41 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: filestat.c,v 1.114 2002/12/31 16:07:40 sebastian Exp $ */
+/* $Id: filestat.c,v 1.115 2003/01/03 14:37:41 hyanantha Exp $ */
 
 #include "php.h"
 #include "safe_mode.h"
@@ -664,26 +664,30 @@
        case FS_INODE:
                RETURN_LONG((long)BG(sb).st_ino);
        case FS_SIZE:
+#if defined(NETWARE) && defined(NEW_LIBC)
+               RETURN_LONG((long)(stat_sb->st_size));
+#else
                RETURN_LONG((long)BG(sb).st_size);
+#endif
        case FS_OWNER:
                RETURN_LONG((long)BG(sb).st_uid);
        case FS_GROUP:
                RETURN_LONG((long)BG(sb).st_gid);
        case FS_ATIME:
 #if defined(NETWARE) && defined(NEW_LIBC)
-               RETURN_LONG((long)(BG(sb).st_atime).tv_nsec);
+               RETURN_LONG((long)((stat_sb->st_atime).tv_sec));
 #else
                RETURN_LONG((long)BG(sb).st_atime);
 #endif
        case FS_MTIME:
 #if defined(NETWARE) && defined(NEW_LIBC)
-               RETURN_LONG((long)(BG(sb).st_mtime).tv_nsec);
+               RETURN_LONG((long)((stat_sb->st_mtime).tv_sec));
 #else
-       RETURN_LONG((long)BG(sb).st_mtime);
+               RETURN_LONG((long)BG(sb).st_mtime);
 #endif
        case FS_CTIME:
 #if defined(NETWARE) && defined(NEW_LIBC)
-               RETURN_LONG((long)(BG(sb).st_ctime).tv_nsec);
+               RETURN_LONG((long)((stat_sb->st_ctime).tv_sec));
 #else
                RETURN_LONG((long)BG(sb).st_ctime);
 #endif
@@ -706,28 +710,25 @@
                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown file type (%d)", 
BG(sb).st_mode&S_IFMT);
                RETURN_STRING("unknown", 1);
        case FS_IS_W:
-#ifdef NETWARE
-               RETURN_LONG(0);
-#endif
+       #ifndef NETWARE /* getuid is not available on NetWare */
                if (getuid()==0) {
                        RETURN_TRUE; /* root */
                }
+       #endif  /* NETWARE */
                RETURN_BOOL((BG(sb).st_mode & wmask) != 0);
        case FS_IS_R:
-#ifdef NETWARE
-               RETURN_LONG(0);
-#endif
+       #ifndef NETWARE /* getuid is not available on NetWare */
                if (getuid()==0) {
                        RETURN_TRUE; /* root */
                }
+       #endif  /* NETWARE */
                RETURN_BOOL((BG(sb).st_mode&rmask)!=0);
        case FS_IS_X:
-#ifdef NETWARE
-               RETURN_LONG(0);
-#endif
+       #ifndef NETWARE /* getuid is not available on NetWare */
                if (getuid()==0) {
                        xmask = S_IXROOT; /* root */
                }
+       #endif  /* NETWARE */
                RETURN_BOOL((BG(sb).st_mode&xmask)!=0 && !S_ISDIR(BG(sb).st_mode));
        case FS_IS_FILE:
                RETURN_BOOL(S_ISREG(BG(sb).st_mode));
@@ -762,9 +763,9 @@
 #endif
                MAKE_LONG_ZVAL_INCREF(stat_size, stat_sb->st_size);
 #if defined(NETWARE) && defined(NEW_LIBC)
-               MAKE_LONG_ZVAL_INCREF(stat_atime, (stat_sb->st_atime).tv_nsec);
-               MAKE_LONG_ZVAL_INCREF(stat_mtime, (stat_sb->st_mtime).tv_nsec);
-               MAKE_LONG_ZVAL_INCREF(stat_ctime, (stat_sb->st_ctime).tv_nsec);
+               MAKE_LONG_ZVAL_INCREF(stat_atime, (stat_sb->st_atime).tv_sec);
+               MAKE_LONG_ZVAL_INCREF(stat_mtime, (stat_sb->st_mtime).tv_sec);
+               MAKE_LONG_ZVAL_INCREF(stat_ctime, (stat_sb->st_ctime).tv_sec);
 #else
                MAKE_LONG_ZVAL_INCREF(stat_atime, stat_sb->st_atime);
                MAKE_LONG_ZVAL_INCREF(stat_mtime, stat_sb->st_mtime);
Index: php4/ext/standard/html.c
diff -u php4/ext/standard/html.c:1.69 php4/ext/standard/html.c:1.70
--- php4/ext/standard/html.c:1.69       Thu Jan  2 14:49:30 2003
+++ php4/ext/standard/html.c    Fri Jan  3 09:37:42 2003
@@ -18,11 +18,13 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: html.c,v 1.69 2003/01/02 19:49:30 iliaa Exp $ */
+/* $Id: html.c,v 1.70 2003/01/03 14:37:42 hyanantha Exp $ */
 
 #include "php.h"
 #if PHP_WIN32
 #include "config.w32.h"
+#elif defined NETWARE
+#include "config.nw.h"
 #else
 #include "php_config.h"
 #endif
Index: php4/ext/standard/syslog.c
diff -u php4/ext/standard/syslog.c:1.41 php4/ext/standard/syslog.c:1.42
--- php4/ext/standard/syslog.c:1.41     Tue Dec 31 11:07:55 2002
+++ php4/ext/standard/syslog.c  Fri Jan  3 09:37:42 2003
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: syslog.c,v 1.41 2002/12/31 16:07:55 sebastian Exp $ */
+/* $Id: syslog.c,v 1.42 2003/01/03 14:37:42 hyanantha Exp $ */
 
 #include "php.h"
 
@@ -75,7 +75,7 @@
        /* AIX doesn't have LOG_AUTHPRIV */
        REGISTER_LONG_CONSTANT("LOG_AUTHPRIV", LOG_AUTHPRIV, CONST_CS | 
CONST_PERSISTENT);
 #endif
-#if !defined(PHP_WIN32)
+#if !defined(PHP_WIN32) && !defined(NETWARE)
        REGISTER_LONG_CONSTANT("LOG_LOCAL0", LOG_LOCAL0, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("LOG_LOCAL1", LOG_LOCAL1, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("LOG_LOCAL2", LOG_LOCAL2, CONST_CS | CONST_PERSISTENT);
@@ -159,7 +159,7 @@
        /* AIX doesn't have LOG_AUTHPRIV */
        SET_VAR_LONG("LOG_AUTHPRIV", LOG_AUTHPRIV);
 #endif
-#if !defined(PHP_WIN32)
+#if !defined(PHP_WIN32) && !defined(NETWARE)
        SET_VAR_LONG("LOG_LOCAL0", LOG_LOCAL0);
        SET_VAR_LONG("LOG_LOCAL1", LOG_LOCAL1);
        SET_VAR_LONG("LOG_LOCAL2", LOG_LOCAL2);



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

Reply via email to