diff options
author | lpsolit%gmail.com <> | 2006-06-14 09:26:27 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2006-06-14 09:26:27 +0200 |
commit | 9d8e3ef8873724dff896687a783dbd1ff3295297 (patch) | |
tree | 037d81b4d9d078fb5ba351bb314e58d217da02c3 /Bugzilla | |
parent | 9d666ab3e6c3516d5b1b63d560c20c19e416e542 (diff) | |
download | bugzilla-9d8e3ef8873724dff896687a783dbd1ff3295297.tar.gz bugzilla-9d8e3ef8873724dff896687a783dbd1ff3295297.tar.xz |
Bug 313255: Move $::ENV{foo} and $::SIG{foo} out of globals.pl - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/CGI.pm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index bc2d39b99..b578b617c 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -45,6 +45,24 @@ use Bugzilla::Config; # We need to disable output buffering - see bug 179174 $| = 1; +# Ignore SIGTERM and SIGPIPE - this prevents DB corruption. If the user closes +# their browser window while a script is running, the webserver sends these +# signals, and we don't want to die half way through a write. +$::SIG{TERM} = 'IGNORE'; +$::SIG{PIPE} = 'IGNORE'; + +# The following subroutine is for debugging purposes only. +# Uncommenting this sub and the $::SIG{__DIE__} trap underneath it will +# cause any fatal errors to result in a call stack trace to help track +# down weird errors. +#sub die_with_dignity { +# use Carp; # for confess() +# my ($err_msg) = @_; +# print $err_msg; +# confess($err_msg); +#} +#$::SIG{__DIE__} = \&die_with_dignity; + # CGI.pm uses AUTOLOAD, but explicitly defines a DESTROY sub. # We need to do so, too, otherwise perl dies when the object is destroyed # and we don't have a DESTROY method (because CGI.pm's AUTOLOAD will |die| |