Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 829631 Details for
Bug 1031096
perl-HTTP-Tiny: error checking in mirror sub
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
[PATCH] Croak on failed write into a file
-Croak-on-failed-write-into-a-file.patch (text/plain), 1.28 KB, created by
Petr Pisar
on 2013-11-27 10:08:00 UTC
(
hide
)
Description:
[PATCH] Croak on failed write into a file
Filename:
MIME Type:
Creator:
Petr Pisar
Created:
2013-11-27 10:08:00 UTC
Size:
1.28 KB
patch
obsolete
>From 7d8effc5b04adab4768615f8382e8f35dd8e110b Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> >Date: Wed, 27 Nov 2013 10:45:39 +0100 >Subject: [PATCH] Croak on failed write into a file >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The mirror() method saves a document into a file. Any error while >writing to the file, e.g. no disk space, was ignored. This patch fixes >it by croaking on such I/O error. > >Signed-off-by: Petr PÃsaÅ <ppisar@redhat.com> >--- > lib/HTTP/Tiny.pm | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/lib/HTTP/Tiny.pm b/lib/HTTP/Tiny.pm >index e81aa8f..5d494c0 100644 >--- a/lib/HTTP/Tiny.pm >+++ b/lib/HTTP/Tiny.pm >@@ -209,7 +209,10 @@ sub mirror { > open my $fh, ">", $tempfile > or Carp::croak(qq/Error: Could not open temporary file $tempfile for downloading: $!\n/); > binmode $fh; >- $args->{data_callback} = sub { print {$fh} $_[0] }; >+ $args->{data_callback} = sub { >+ print {$fh} $_[0] >+ or Carp::croak(qq/Error: Could not write into temporary file $tempfile: $!\n/); >+ }; > my $response = $self->request('GET', $url, $args); > close $fh > or Carp::croak(qq/Error: Could not close temporary file $tempfile: $!\n/); >-- >1.8.3.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 1031096
: 829631 |
829632