[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Broken RETURNMAIN macro in main.c
I reported this by e-mail a few days ago, but haven't heard anything.
I just upgraded to glimpse-4.12.5 (I also tried the .6 developer's version).
Things work as they're supposed to, but the exit codes aren't set correctly
causing other programs to exit (e.g., tkman). Surely, asking for the version
number shouldn't return an error, but this is what the code has:
case 'V' :
printf("\nThis is glimpse version %s, %s.\n\n",
GLIMPSE_VERSION, GLIMPSE_DATE);
RETURNMAIN(0);
Looks good, but the macro changes it to exit(1):
#define RETURNMAIN(val)\
{\
CLEANUP;\
if (val < 0) exit (2);\
else if (val == 0) exit (1);\
else exit (0);\
}
I manually put in an exit(0) for the RETURNMAIN(0) above and now tkman doesn't
die (it does report nonzero exit codes in other places where glimpse is run),
but this code clearly seems broken.
David