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

Laurent Léonard laurent at open-minds.org
Sat Oct 31 13:29:42 UTC 2009


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20091031/8933e5a6/attachment-0001.sig>


More information about the libvir-list mailing list