Re: [libvirt] [PATCH 10/21] Don't let parent of daemon exit until basic initialization is done

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

 



Hi,

I'm not a C expert, but I see there is a use of an unitialized variable:

    default:
        {
            int got, exitstatus = 0;
            int ret;
            char status;

            close(statuspipe[1]);

            /* We wait to make sure the first child forked successfully */
            if ((got = waitpid(pid, &exitstatus, 0)) < 0 ||
                got != pid ||
                status != 0) {   <<< here
                return -1;
            }

That explains the issue described by Guido, because he uses an i386 system. It 
was impossible for me to reproduce the issue because I use an amd64 system.

char test;
if (test == 0)
	puts("ok");
else
	puts("ko");

produces:
- "ok" on amd64 system
- "ko" on i386 system

If I use the exitstatus variable in the test it seems to work great on both 
architectures.

-- 
Laurent Léonard

Attachment: signature.asc
Description: This is a digitally signed message part.

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]