On 05/14/2012 12:25 PM, Luiz Capitulino wrote: > POSIX mandates[1] that a child process of a multi-thread program uses > only async-signal-safe functions before exec(). We consider qemu-ga > to be multi-thread, because it uses glib. > > However, qmp_guest_shutdown() uses functions that are not > async-signal-safe. Fix it the following way: > > - fclose() -> reopen_fd_to_null() > - execl() -> execle() > - exit() -> _exit() > - drop slog() usage (which is not safe) > > [1] http://pubs.opengroup.org/onlinepubs/009695399/functions/fork.html > > Signed-off-by: Luiz Capitulino <lcapitul...@redhat.com> > --- > > o v2 > > - fix doc typo > - drop 'ret' and use EXIT_FAILURE instead
Not addressed was the 'environ' declaration issue, but I'm okay if you save it for another day when we actually get a compile failure for using an undeclared variable (since what you have _does_ work on glibc). Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake ebl...@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature