[libvirt] [PATCHv2] daemon: clean up daemonization

Eric Blake eblake at redhat.com
Wed Dec 28 12:15:41 UTC 2011


On 12/27/2011 03:51 AM, Daniel Veillard wrote:
> On Fri, Dec 23, 2011 at 02:13:53PM -0700, Eric Blake wrote:
>> Valgrind detected a pipe fd leak before the parent exits on success,
>> introduced in commit 4296cea; by itself, the leak is not bad, since
>> we immediately called _exit(), but we might as well be clean to make
>> valgrind analysis easier.  Meanwhile, if the daemon grandchild detects
>> an error, the parent failed to flush the error message before exiting.
>> Also, we had the possibility of both parent and child returning to the
>> caller, such that the user could see duplicated reports of failure
>> from the two return paths.  And we might as well be robust to the
>> (unlikely) situation of being started with stdin closed.
>>

>> +            if (ret != 1) {
>> +                fprintf(stderr,
>> +                        _("%s: error: unable to determine if daemon is "
>> +                          "running: %s\n"), argv0, strerror(errno));
>> +                exit(EXIT_FAILURE);

I switched this to virStrerror to appease 'make syntax-check'...

> 
>   ACK to the Chrismas patch :-)

and pushed.

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 620 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20111228/5402bbd2/attachment-0001.sig>


More information about the libvir-list mailing list