[libvirt] [PATCH] Fix virProcessKillPainfully on Win32

Eric Blake eblake at redhat.com
Tue Oct 16 15:33:54 UTC 2012


On 10/16/2012 08:47 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> Win32 platforms don't have SIGKILL defined, but they do have
> SIGABRT. Since our virProcess wrapper treats anything which
> isn't SIGTERM/SIGINT as equivalent to SIGKILL, just use
> SIGABRT on Win32.
> 
> Pushed as a Win32 build break fix
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  src/util/virprocess.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/src/util/virprocess.c b/src/util/virprocess.c
> index c70aa58..fee333f 100644
> --- a/src/util/virprocess.c
> +++ b/src/util/virprocess.c
> @@ -267,8 +267,15 @@ virProcessKillPainfully(pid_t pid, bool force)
>          } else if ((i == 50) & force) {
>              VIR_DEBUG("Timed out waiting after SIGTERM to process %d, "
>                        "sending SIGKILL", pid);
> +            /* No SIGKILL kill on Win32 ! Use SIGABRT instead which our
> +             * virProcessKill proc will handle more or less lik SIGKILL */

s/lik/like/

> +#ifdef WIN32
> +            signum = SIGABRT; /* kill it after a grace period */
> +            signame = "ABRT";
> +#else
>              signum = SIGKILL; /* kill it after a grace period */
>              signame = "KILL";
> +#endif
>          } else {
>              signum = 0; /* Just check for existence */
>          }
> 

-- 
Eric Blake   eblake at redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121016/8ccdcd4f/attachment-0001.sig>


More information about the libvir-list mailing list