diff options
Diffstat (limited to 'lib/JWebmail/Model/ReadMails')
-rw-r--r-- | lib/JWebmail/Model/ReadMails/QMailAuthuser.pm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/JWebmail/Model/ReadMails/QMailAuthuser.pm b/lib/JWebmail/Model/ReadMails/QMailAuthuser.pm index 311860c..19f8b12 100644 --- a/lib/JWebmail/Model/ReadMails/QMailAuthuser.pm +++ b/lib/JWebmail/Model/ReadMails/QMailAuthuser.pm @@ -211,21 +211,21 @@ sub read_qmauth { my $input = <$reader>; - my $rc; + my $rs; if (eof $reader) { # for regular open close $reader or warn "closing read pipe failed: $!"; - $rc = $? >> 8; + $rs = $?; # for IPC::Open2 if (waitpid($pid, 0) == $pid) { - $rc = $? >> 8; + $rs = $?; } } - my $resp; - if (!defined $rc) { + my ($resp, $rc); + if (!defined $rs) { my ($r, $e); eval { $r = decode_json $input; 1 } or do { @@ -242,18 +242,18 @@ sub read_qmauth { $resp = { head => $r, body => $buf, - rc => $rc, + rc => $?, e => $e, }; } - elsif ($rc == 3 || $rc == 0) { + elsif ($rs == 3 << 8 || $rs == 0) { eval { $resp = decode_json $input if $input; 1 } or do { $resp = { info => "error decoding response", response => $input, cause => $@, - return_code => $rc, + return_code => $rs >> 8, }; $rc = 3; }; |