cvs: php4 /main main.c
| From: | Sascha Schumann | Date: | Tue, 13 May 2003 02:26:42 +0000 |
| Subject: | cvs: php4 /main main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20853@lists.php.net to get a copy of this message | ||
sas Mon May 12 22:26:42 2003 EDT
Modified files:
/php4/main main.c
Log:
MFB don't close random fds
Index: php4/main/main.c
diff -u php4/main/main.c:1.551 php4/main/main.c:1.552
--- php4/main/main.c:1.551 Wed May 7 21:23:20 2003
+++ php4/main/main.c Mon May 12 22:26:42 2003
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.551 2003/05/08 01:23:20 iliaa Exp $ */
+/* $Id: main.c,v 1.552 2003/05/13 02:26:42 sas Exp $ */
/* {{{ includes
*/
@@ -1565,7 +1565,7 @@
zend_file_handle *prepend_file_p, *append_file_p;
zend_file_handle prepend_file, append_file;
#if HAVE_BROKEN_GETCWD
- int old_cwd_fd;
+ int old_cwd_fd = -1;
#else
char *old_cwd;
#endif
@@ -1649,8 +1649,10 @@
} zend_end_try();
#if HAVE_BROKEN_GETCWD
- fchdir(old_cwd_fd);
- close(old_cwd_fd);
+ if (old_cwd_fd != -1) {
+ fchdir(old_cwd_fd);
+ close(old_cwd_fd);
+ }
#else
if (old_cwd[0] != '\0') {
VCWD_CHDIR(old_cwd);