[libvirt] Re: [Libvir] [PATCH] lxc: handle SIGCHLD from exiting container

Dave Leskovec dlesko at linux.vnet.ibm.com
Wed May 7 20:23:46 UTC 2008


Jim Meyering wrote:
> Dave Leskovec <dlesko at linux.vnet.ibm.com> wrote:
>> Jim Meyering wrote:
>>> Dave Leskovec <dlesko at linux.vnet.ibm.com> wrote:

...

>> Index: b/qemud/qemud.c
>> ===================================================================
> ...
>> +static void sig_handler(int sig, siginfo_t * siginfo,
>> +                        void* context ATTRIBUTE_UNUSED) {
> ...
>> -    unsigned char sigc;
>> +    siginfo_t siginfo;
>>      int ret;
>>
>> -    if (read(server->sigread, &sigc, 1) != 1) {
>> +    if (read(server->sigread, &siginfo, sizeof(siginfo)) != sizeof(siginfo)) {
> 
> Looks good, but that should be saferead instead of "read".
> Now that it's reading more than one byte, EINTR can make a difference.
> 

This latest version of this patch changes the read() to a saferead() as Jim
points out.

-- 
Best Regards,
Dave Leskovec
IBM Linux Technology Center
Open Virtualization
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lxc_sigchld.patch
Type: text/x-patch
Size: 10937 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20080507/7b654e9d/attachment-0001.bin>


More information about the libvir-list mailing list