[hatari-devel] Exit status mismatch for hmsa

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi everyone, and thanks for the work on hatari.

I use the hmsa utility as part of my build process, and I check its exit status for success.

I am finding that the exit status is swapped: it returns 0 for error and 1 for success, when I expect the opposite.

I have traced the issue in hmsa.c:
In lines 164 and 263, the return value of main(), retVal, is an int, as expected.
However, in lines 243 and 254, retVal is initialized with the return value of File_Save and MSA_WriteDisk respectively, and those functions return a bool, where false (0) is error and true (1) is success.
I have locally tweaked the code of lines 243 and 254, adding ? 0 : -1, and tested accordingly.

Feel free to use that change without credit. No rush.

Thanks again for all the work.

JBQ


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/