Menu

#308 xsetwacom exit status should not always be zero

closed-wont-fix
nobody
None
xf86-input-wacom
2017-05-10
2016-02-02
No

It appears that xsetwacom always returns an exit status of zero even when it encounters an error. Some of the commands below succeed, and some do not, but all return an exit status of zero. This should not be the case, since an exit status of zero indicates success, and always returning zero makes it impossible for a script to distinguish between success and failure.

$ xsetwacom set "Wacom Intuos3 9x12 Pad pad" Button 1 0
$ echo $?
0

$ xsetwacom set "Wacom Intuos3 9x12 pad" Button 1 0
Cannot find device 'Wacom Intuos3 9x12 pad'.
$ echo $?
0

$ xsetwacom get "Wacom Intuos3 9x12 Pad pad" Button 1
button +0
$ echo $?
0

$ xsetwacom get "Wacom Intuos3 9x12 Pad pad" Button 1 0
'Button' requires exactly 1 value(s).
$ echo $?
0

$ xsetwacom get "Wacom Intuos3 9x12 pad" Button 1
Cannot find device 'Wacom Intuos3 9x12 pad'.
$ echo $?
0

Discussion

  • Jason Gerecke

    Jason Gerecke - 2016-02-02

    A patch for this issue might be somewhat slow coming... Its not terribly hard work, but many many functions are written to return "void" instead of an error code. If you've got any skill at C programming and some free time, it might be an interesting project to take on.

    As an aside, xsetwacom was never really designed to be terribly script friendly (it was assumed that a user would be either running the commands directly, or running them in a script only after verifying they worked properly) so even after this is fixed there's still probably more scripting bugs lurking...

     
  • Ping Cheng

    Ping Cheng - 2017-05-10
    • status: new --> closed-wont-fix