[mythtv] [patch] Exit Uniqueness, a cleanup patch

Daniel Thor Kristjansson danielk at cat.nyu.edu
Tue Aug 17 13:29:36 EDT 2004


This scratches an itch for me. There are about a hundred random exit
calls in the code. I made each one that represented an error condition
have a unique return code*. This means you can find out where your
program exited by simply looking at the return code. I did not address
the ones that are removed by David George's patch, nor ones that might
exist outside the lib and programs directories.

* if the exit was for a broken exec call in a fork, I left it alone.

I also tried to make sure they all print something out before exiting
the program. I gave the ones in lib a negative return value and the
ones in programs a positive return value. There were a few in there that
exited with a 0 for error conditions, and many that seem like they
shouldn't be exiting the program in the first place. An bad packet in an
MP3 stream really shouldn't kill the program IMHO. I would encourage
everyone to look in the sections of code they play in to see if error
conditions can be addressed better, especially in libs.

-- Daniel

More information about the mythtv-dev mailing list