Skip to content

Commit e8556af

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 19f3312 commit e8556af

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
@@ -755,6 +755,10 @@ RunMultiWas(struct was_multi *m)
755755

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

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

0 commit comments

Comments
 (0)