mlt
mlt copied to clipboard
Melt should non-zero exit on SIGINT/SIGTERM
Looking at the code, SIGINT calls stop_handler()
which exits 'nicely'. It should exit as at present but with a non-zero code to indicate that rendering did not complete successfully.
melt is not only used for rendering. Who says it should behave as you claim? It’s been like that for over 15 years and no one else has complained nor have I needed it. Give some real world case where this is affecting you. Then, submit a pull request. Otherwise, I don’t need it and have no plan to address.
In my case I'm calling melt via shell from a script. If user ctrl-c's the (long) rendering process I want to be able to capture that and abort the script. Generally speaking, if a program on unix exits unsuccessfully (ie the outputted file is only partial) the exit code is non-zero to signal this to calling processes so I would have expected it in this case.
I concur with mzealey... exiting on a signal should never ever exit(0) !
You can either exit(1) or possibly pass the signal through, which can be done by: signal(SIGINT, SIG_DFL); kill(getpid(), SIGINT);
I am OK to make a change, but I had to ask instead of simply react. I just have not to around to this change and would appreciate a pull request.