sniper Tue Jan 18 10:45:01 2005 EDT
Modified files: (Branch: PHP_4_3)
/php-src/ext/session mod_files.c
Log:
MFH: - Use FD_CLOEXEC with fcntl() and make sure it is always defined
http://cvs.php.net/diff.php/php-src/ext/session/mod_files.c?r1=1.83.2.8&r2=1.83.2.9&ty=u
Index: php-src/ext/session/mod_files.c
diff -u php-src/ext/session/mod_files.c:1.83.2.8
php-src/ext/session/mod_files.c:1.83.2.9
--- php-src/ext/session/mod_files.c:1.83.2.8 Mon Mar 29 16:28:47 2004
+++ php-src/ext/session/mod_files.c Tue Jan 18 10:45:01 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mod_files.c,v 1.83.2.8 2004/03/29 21:28:47 wez Exp $ */
+/* $Id: mod_files.c,v 1.83.2.9 2005/01/18 15:45:01 sniper Exp $ */
#include "php.h"
@@ -162,8 +162,11 @@
flock(data->fd, LOCK_EX);
#ifdef F_SETFD
- if (fcntl(data->fd, F_SETFD, 1)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING,
"fcntl(%d, F_SETFD, 1) failed: %s (%d)", data->fd, strerror(errno), errno);
+#ifndef FD_CLOEXEC
+#define FD_CLOEXEC 1
+#endif
+ if (fcntl(data->fd, F_SETFD, FD_CLOEXEC)) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
"fcntl(%d, F_SETFD, FD_CLOEXEC) failed: %s (%d)", data->fd, strerror(errno),
errno);
}
#endif
} else {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php