[PHP-DEV] CVS update: php3/functions From: zeev (php-dev <email protected>)
Date: 04/29/98

Date: Wednesday April 29, 1998 @ 10:24
Author: zeev

Update of /repository/php3/functions
In directory asf:/tmp/cvs-serv12393/functions

Modified Files:
        file.c
Log Message:
Fix fpassthru():

A resource that's in the resource list must *ONLY* be handled by its destructors, and
never destroyed manually. When the resource is no longer needed, one should delete
it from the list using php3_list_delete(), which in turn, would run the registered
destructors on it.
In this case, the file pointer was being both closed manually, and implicitly by
the registered resource list destructor. I commented out the manual closing,
since the author *might* have done this intentionally for some reason (either way
it has to be fixed, since it was crashing).

Index: php3/functions/file.c
diff -c php3/functions/file.c:1.159 php3/functions/file.c:1.160
*** php3/functions/file.c:1.159 Wed Apr 29 09:24:11 1998
--- php3/functions/file.c Wed Apr 29 10:24:29 1998
***************
*** 26,32 ****
     | Authors: Rasmus Lerdorf <rasmus <email protected>> |
     +----------------------------------------------------------------------+
   */
! /* $Id: file.c,v 1.159 1998/04/29 13:24:11 ssb Exp $ */
  #ifdef THREAD_SAFE
  #include "tls.h"
  #endif
--- 26,32 ----
     | Authors: Rasmus Lerdorf <rasmus <email protected>> |
     +----------------------------------------------------------------------+
   */
! /* $Id: file.c,v 1.160 1998/04/29 14:24:29 zeev Exp $ */
  #ifdef THREAD_SAFE
  #include "tls.h"
  #endif
***************
*** 925,930 ****
--- 925,931 ----
                          size += b ;
                  }
          }
+ /*
          if(issock) {
  #if WIN32|WINNT
                  closesocket(socketd);
***************
*** 934,939 ****
--- 935,941 ----
          } else {
                  fclose(fp);
          }
+ */
          php3_list_delete(id);
          RETURN_LONG(size);
  }