On 2/21/2014 2:17 PM, Antonio Diaz Diaz wrote:
Then Ctrl-c can't be reliably differentiated from a normal exit with 0
status.
You mentioned thinking about raising SIGNT for interrupted ddrescue exit
. I did not try that, and would have to look into how. But what might it
break? I don't want anything to get broken for anybody else.
You can't use the status returned by waitpid this way. It includes
several values and must be tested with the corresponding macros[1]
like this:
Yes, I know this (now), but it is what worked for me since there seemed
to be no other way. Shows my amateur programming status, I still have
much to learn. And just to make sure we are on the same page, I am using
the "system" command to call ddrescue.
It is the safest option (in case someone uses 'status & 0xFF' as
return value), but it is quite a change to consider an user-finished
run as an error.
Is there another way that would work? I am open to anything that would
work and be consistent. Even if it means adding an option for advanced
users to get a different return value. I can make modifications to
ddresuce to suit my own purposes, but there are certain things that I
would like to see work well with my public software, and this is a big one.
Scott
_______________________________________________
Bug-ddrescue mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-ddrescue