Re: [hatari-devel] Exit status mismatch for hmsa

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


Thanks a lot for the amazingly fast turnaround, and thanks for the kind words. I confirm that the fixed version works for me, the exit status is as I expect.

JBQ

On Sat, Dec 14, 2024 at 7:51 PM Thomas Huth <th.huth@xxxxxxxxx> wrote:
Am Sat, 14 Dec 2024 09:59:54 +0200
schrieb Jean-Baptiste Queru <jbqueru@xxxxxxxxx>:

> 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.

 Hi!

Thanks for the report and the analyzis, it should be fixed now!

 Thomas




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