bug-ddrescue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-ddrescue] 2 Suggestions (bi-directional retry and user interrup


From: Scott Dwyer
Subject: Re: [Bug-ddrescue] 2 Suggestions (bi-directional retry and user interruption exit code)
Date: Fri, 21 Feb 2014 18:16:50 -0500
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]