|
SA Bugzilla – Full Text Bug Listing |
Summary: | [review] -e exit code option not working | ||
---|---|---|---|
Product: | Spamassassin | Reporter: | cemmitt |
Component: | spamassassin | Assignee: | SpamAssassin Developer Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | thomas |
Priority: | P3 | ||
Version: | 3.1.2 | ||
Target Milestone: | 3.1.4 | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | can be committed | ||
Attachments: | suggested patch |
Description
cemmitt
2006-05-30 20:31:59 UTC
I found the same on SuSE 10.1. The exit code is always 0. Hrm. This is caused by the fix for bug 3754. Basically we needed to kluge in a return value when files can't be read, etc. Interestingly, the problem seems to be related to a perl "feature". Specifically, it looks like: eval { $exitvalue ||= !$iter->run(@targets); }; the decision to set $exitvalue (ala "||=") is made first (because $exitvalue is undefined), then it's set to the return from run() -- however, the wanted() function (called from run()) sets the global variable, so we get: $exitvalue = undef; # start $exitvalue = 5; # set in wanted() via run() $exitvalue = 1; # set in the eval {} $ perl -e '$t ||= foo(); sub foo { $t = 5; return 1; } print "$t\n"' 1 So, interesting. Patch coming shortly. Created attachment 3547 [details]
suggested patch
wow. +1 +1 Sending spamassassin.raw Transmitting file data . Committed revision 420375. |