On Thu, 2012-09-06 at 12:23 +0000, Sebastian Freundt wrote:
Graham Anderson <graham.anderson@gmail.com> writes:
On Thursday 06 Sep 2012 06:31:49 Brian K. White wrote:
On 9/6/2012 6:00 AM, Graham Anderson wrote:
On Thursday 06 Sep 2012 05:01:52 Brian K. White wrote:
Another example I saw a while back was rsync. rsync hasd had a certain set of exit values with various meanings, all nicely documented in their man pages and also predating systemd by over 10 years? Yet systemd called rsync's behavior a bug because there were some exit values other than 0 that didn't necessarily indicate an error.
That particular issue seemed pretty clear cut to me, posix defines 0 or EXIT_SUCCESS(0) as the *only* indication of clean termination. If software catches a signal which is meant to cleanly terminate the program and issues something other than 0, and this is against conventions and standards, why can it not be considered a bug?
Cheers the noo, Graham
No that is not what posix says.
Sorry, but it is:
"A value of zero (or EXIT_SUCCESS, which is required to be zero) for the argument status conventionally indicates successful termination. This corresponds to the specification for exit() in the ISO C standard. The convention is followed by utilities such as make and various shells, which interpret a zero status from a child process as success."
It only says that if status is 0 it must be interpreted as success. The converse doesn't necessarily follow. And if you're pedantic, you could argue (see footnote CX) that only EXIT_FAILURE may be used to indicate failure.
People should be aware that there might be other result codes besides "0" and "-1" or 255. You learn that when doing multi platform scripting. I thing it was on slowarix (or hp-ux) that to my horror i noticed that "ping" allmost always returned "succes". After inquiring i was told that: "ping was able to send the ICMP, hence you got succes, wether or not the recipiant exists and/or replies is not of our concern..." In linux you get an return-code "2" in such cases. hw -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org