Peng Yu wrote:
> exit -1
Especially when coming from C programming it is easy to fall into the
habit of always returning -1 upon an error. However that is function
returns and not process exit codes. With process that -1 will be
translated into exit 255 because that is what exit(3) does with -1.
man 3 exit
The system exit value is restricted to unsigned 8-bits and therefore
the range 0 to 255. As a matter of good style it is better to use
exit 1 or other explicit value within the restricted 8-bit unsigned
range rather than -1 that way the value received by the caller waiting
on the child will be the same as the one the child sent.
Bob