|
From: | Antonio Diaz Diaz |
Subject: | Re: [Bug-ddrescue] 2 Suggestions (bi-directional retry and user interruption exit code) |
Date: | Wed, 26 Feb 2014 16:41:32 +0100 |
User-agent: | Mozilla/5.0 (X11; U; Linux i586; en-US; rv:1.7.11) Gecko/20050905 |
Scott Dwyer wrote:
A very quick test on Fedora with the hacked code seemed to do the trick.
Good.
So the compiler obviously needs the "return 0;" to be happy, but the program actually exits on the "std::raise( SIGINT );"?
I suppose the compiler can't know if the 'raise' will terminate the program, so it needs the 'return'.
Curious thought, a normal exit will free memory and close open files that were missed by an inexperienced programmer like me. But will this style exit do the same?
Good question. I had to search for the answer and it seems it does indeed the same:
http://www.gnu.org/software/libc/manual/html_node/Termination-Internals.html"When a process terminates for any reason -- either because the program terminates, or as a result of a signal -- the following things happen:"
Best regards, Antonio.
[Prev in Thread] | Current Thread | [Next in Thread] |