Skip to content

Commit 62f3582

Browse files
committed
sapi/was: ignore SIGPIPE
This avoids getting killed by SIGPIPE when submitting a query to a dead MySQL connection. All the other SAPIs ignore SIGPIPE as well - I didn't implement it for WAS because I thought this was part of zend_signal_startup(), but it's not.
1 parent 2f1be2d commit 62f3582

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sapi/was/was_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,10 @@ RunMultiWas(struct was_multi *m)
756756

757757
int main(int argc, char *argv[])
758758
{
759+
#if defined(SIGPIPE) && defined(SIG_IGN)
760+
signal(SIGPIPE, SIG_IGN);
761+
#endif
762+
759763
zend_signal_startup();
760764

761765
struct CommandLine command_line = { .ini_ignore = false };

0 commit comments

Comments
 (0)