]> Git Repo - qemu.git/commit
qemu-ga: guest-shutdown: use only async-signal-safe functions
authorLuiz Capitulino <[email protected]>
Mon, 14 May 2012 18:25:20 +0000 (15:25 -0300)
committerMichael Roth <[email protected]>
Tue, 15 May 2012 14:15:16 +0000 (09:15 -0500)
commit3674838cd05268954bb6473239cd7f700a79bf0f
tree87b737a98ccd7ed630197b3c5fa094170e6d8160
parentd5dd3498ebf4d6dc8661f6a9a69ae10b50f3a6a6
qemu-ga: guest-shutdown: use only async-signal-safe functions

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 <[email protected]>
Reviewed-by: Eric Blake <[email protected]>
Signed-off-by: Michael Roth <[email protected]>
qapi-schema-guest.json
qga/commands-posix.c
This page took 0.023098 seconds and 4 git commands to generate.