Skip to content

Commit 0738a6e

Browse files
author
Mikhail Galanin
committed
Fixing tests
1 parent 4aba136 commit 0738a6e

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

main/fastcgi.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,9 +1423,13 @@ int fcgi_accept_request(fcgi_request *req)
14231423
return -1;
14241424
}
14251425

1426+
#ifdef F_SETFD
1427+
# ifdef FD_CLOEXEC
14261428
if (0 > fcntl(req->fd, F_SETFD, fcntl(req->fd, F_GETFD) | FD_CLOEXEC)) {
14271429
fcgi_log(FCGI_WARNING, "failed to change attribute of error_log");
14281430
}
1431+
# endif
1432+
#endif
14291433

14301434
#ifdef _WIN32
14311435
break;

sapi/fpm/tests/listen-socket-closed-on-exec.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ $code = <<<'EOT'
3131
echo "My sockets (expect to see 2 of them):\n";
3232
3333
$mypid = getmypid();
34-
$ph = popen("lsof -Pn -p$mypid 2>&1 | grep TCP", 'r');
34+
$ph = popen("/bin/sh -c 'lsof -Pn -p$mypid' 2>&1 | grep TCP", 'r');
3535
echo stream_get_contents($ph);
3636
pclose($ph);
3737
3838
echo "\n\n";
3939
4040
echo "Sockets after exec(), expected to be empty:\n";
41-
$ph = popen("lsof -Pn -p\$\$ 2>&1 | grep TCP", 'r');
41+
$ph = popen("/bin/sh -c 'lsof -Pn -p\$\$' 2>&1 | grep TCP", 'r');
4242
var_dump(stream_get_contents($ph));
4343
pclose($ph);
4444

0 commit comments

Comments
 (0)