In that particular case, refrain from printing "diff: exit code 1"
because that exit status doesn't indicate an error condition.
Issue noticed by and patch OK'ed by ajacoutot@.
"I agree with the goal, and I suspect the diff actually achieves it" guenther@.
#!/usr/bin/perl -T
-# $OpenBSD: security,v 1.34 2015/03/27 13:26:19 schwarze Exp $
+# $OpenBSD: security,v 1.35 2015/04/21 10:24:22 schwarze Exp $
#
# Copyright (c) 2011, 2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
# Copyright (c) 2011 Andrew Fresh <andrew@afresh1.com>
and return;
local $/;
my $diff = <$fh>;
- close_or_nag $fh, "diff";
+ {
+ close $fh and last;
+ nag $!, "diff: error closing pipe: $!" and last;
+ nag $? >> 8 > 1, "diff: exit code " . ($? >> 8);
+ }
return nag !!$diff, $diff;
}