GNOME Bugzilla – Bug 320535
dogtail-run-headless throws away return value from xinit
Last modified: 2005-11-02 22:42:00 UTC
Assuming my shell-fu is correct, dogtail-run-headless currently always returns an implicit successful exit value. "dogtail-run-headless true" and "dogtail-run-headless false" ought to have success/failure exit codes respectively, but currently both have an implicit success exit code
Created attachment 54239 [details] [review] Patch to save exit code of xinit and exit dogtail-run-headless with it
To reproduce, try: dogtail-run-headless false echo $? Without the patch I get this output: 0 (a success code, even though I failed to connect to the X server due to some auth issue, and the script would have been a failure had it been run) With the patch I get this output: 1 (i.e. an error code, as it should be; having said that, the xinit is failing to auth against the Xvfb in my tests for some reason)
With this patch, dogtail-run-headless still exits with 0 every time. I tried '/bin/false' and 'exit 5'. Here's a patch that I wrote, that works for me. It uses the actual return code of the arguments you pass to dogtail-run-headless, instead of relying on xinit to be faithful. Please test.
Created attachment 54247 [details] [review] patch to save exit code of arguments passed to dogtail-run-headless and exit with it
Created attachment 54249 [details] [review] patch to save exit code of arguments passed to dogtail-run-headless and exit with it
Committed.