Red Hat Bugzilla – Bug 982691
virt-sandbox exit code wraps back to 0 at 256,512 etc.
Last modified: 2013-07-09 11:15:54 EDT
Description of problem:
The exit code after running virt-sandbox wraps at number 256,512 etc. back to 0.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create a test command/script to execute inside the container
# cat <<EOF >/usr/local/bin/exit-code-test.sh
# chmod 755 /usr/local/bin/exit-code-test.sh
2. run the above command/script using virt-sandbox
# virt-sandbox -c lxc:/// -n container-001 /usr/local/bin/exit-code-test.sh
# echo $?
For my testing I just repeated steps 1 and 2 editing the exit value in script exit-code-test.sh between test runs.
Exit code wraps at 256 and returns value 0
Exit code should not wrap around and return the actual exit code of the command
Err, that's nothing todo with libvirt-sandbox. This is simply a UNIX limitation. You can't have any exit code > 255, since only 8 bits are available. You can see this just using bash directly
$ exit 256
# echo $?