ASF Bugzilla – Attachment 16302 Details for
Bug 36492
split-logfile script dies when splitting log of many virtual hosts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
This patch fixes described problem.
split-logfile.in.patch (text/plain), 956 bytes, created by
Michal Kwiatkowski
on 2005-09-04 17:04:23 UTC
(
hide
)
Description:
This patch fixes described problem.
Filename:
MIME Type:
Creator:
Michal Kwiatkowski
Created:
2005-09-04 17:04:23 UTC
Size:
956 bytes
patch
obsolete
>--- split-logfile.in.old 2005-09-04 16:47:54.748167168 +0200 >+++ split-logfile.in 2005-09-04 16:51:17.607327888 +0200 >@@ -26,6 +26,9 @@ > # The combined log file is read from stdin. Records read > # will be appended to any existing log files. > # >+ >+use Errno qw(EMFILE); >+ > %is_open = (); > > while ($log_line = <STDIN>) { >@@ -52,8 +55,18 @@ > # yet, do it now. > # > if (! $is_open{$vhost}) { >- open $vhost, ">>${vhost}.log" >- or die ("Can't open ${vhost}.log"); >+ while(not open $vhost, ">>${vhost}.log") { >+ if ($! == EMFILE) { >+ $to_close = each %is_open; >+ while ($to_close eq $vhost) { >+ $to_close = each %is_open; >+ } >+ close $to_close; >+ $is_open{$to_close} = 0; >+ } else { >+ die ("Can't open ${vhost}.log: $!\n"); >+ } >+ } > $is_open{$vhost} = 1; > } > #
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 36492
: 16302