Browse Source

modified to 3rd argument of fcntl to FD_CLOEXEC

PHP-5.1
Anantha Kesari H Y 22 years ago
parent
commit
47e4f575c2
  1. 7
      ext/session/mod_files.c

7
ext/session/mod_files.c

@ -166,12 +166,7 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
flock(data->fd, LOCK_EX);
#ifdef F_SETFD
#ifdef NETWARE
/* NetWare LibC returns -1 upon error and upon success it returns non-zero unlike zero in other OSes*/
if (fcntl(data->fd, F_SETFD, 1) == -1) {
#else
if (fcntl(data->fd, F_SETFD, 1)) {
#endif
if (fcntl(data->fd, F_SETFD, FD_CLOEXEC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "fcntl(%d, F_SETFD, 1) failed: %s (%d)", data->fd, strerror(errno), errno);
}
#endif

Loading…
Cancel
Save