This is with non-modified ddrescue. I was looking at the return value
raw, not using the proper WEXITSTATUS, and found it to not be zero if
terminated by ctrl-c. I believe the value would was 0x0200, showing the
SIGNT as the high order byte. After looking into it, I do not believe
this is normal behavior for a process that handles the SIGNT on its own,
only something that I stumbled onto using my system and thought it would
work all the time. So I do believe that the only sure way to tell if
ddrescue was terminated by the user is to make it exit with a nonzero value.
On 2/20/2014 12:52 PM, Antonio Diaz Diaz wrote:
Scott D wrote:
I also did not realize that the method that I use in C to tell if
ddrescue exited by termination does not work on all systems. I have
revised my code to use WTERMSIG and WEXITSTATUS as opposed to the not
so correct slop I had previously written. It works fine in Ubuntu.
But I tested it on Fedora and on a Mac (in virtual machines), and it
doesn't work on them. It would appear that Ubuntu carries over the
WTERMSIG after ddrescue is terminated, but the other systems do not.
But, have you modified ddrescue to terminate by raising SIGINT when
the user hits Ctrl-C?
If you have modified ddrescue and it does not work on all systems, I
think the only way to tell if ddrescue was terminated by the user is
to make it exit with a nonzero value.
_______________________________________________
Bug-ddrescue mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-ddrescue
_______________________________________________
Bug-ddrescue mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-ddrescue