Skip to content

Commit

Permalink
errno is no longer zero coming out of IO::AIO
Browse files Browse the repository at this point in the history
As of IO::AIO 3.7, you have to actually read the return code.
  • Loading branch information
dormando committed Jun 8, 2011
1 parent ec07ca0 commit 3031ab7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Perlbal/ClientHTTP.pm
Expand Up @@ -294,7 +294,7 @@ sub handle_delete {
# now attempt the unlink
Perlbal::AIO::aio_unlink($self->{service}->{docroot} . '/' . $uri, sub {
my $err = shift;
if ($err == 0 && !$!) {
if ($err == 0) {
# delete was successful
return $self->send_response(204);
} elsif ($! == ENOENT) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Perlbal/ClientProxy.pm
Expand Up @@ -1207,7 +1207,7 @@ sub purge_buffered_upload {
eval {
# now asynchronously unlink the file
Perlbal::AIO::aio_unlink($self->{bufilename}, sub {
if ($!) {
if ($_[0] != 0 && $!) {
# note an error, but whatever, we'll either overwrite the file later (O_TRUNC | O_CREAT)
# or a cleaner will come through and do it for us someday (if the user runs one)
Perlbal::log('warning', "Unable to link $self->{bufilename}: $!");
Expand Down

0 comments on commit 3031ab7

Please sign in to comment.