sniper Tue Jan 18 10:45:51 2005 EDT
Modified files: (Branch: PHP_5_0)
/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.95.2.2&r2=1.95.2.3&ty=u
Index: php-src/ext/session/mod_files.c
diff -u php-src/ext/session/mod_files.c:1.95.2.2
php-src/ext/session/mod_files.c:1.95.2.3
--- php-src/ext/session/mod_files.c:1.95.2.2 Wed Jan 5 20:59:52 2005
+++ php-src/ext/session/mod_files.c Tue Jan 18 10:45:51 2005
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mod_files.c,v 1.95.2.2 2005/01/06 01:59:52 sniper Exp $ */
+/* $Id: mod_files.c,v 1.95.2.3 2005/01/18 15:45:51 sniper Exp $ */
#include "php.h"
@@ -166,8 +166,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