[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] io/command: implement portable spawn
From: |
Marc-André Lureau |
Subject: |
Re: [PATCH] io/command: implement portable spawn |
Date: |
Thu, 1 Sep 2022 17:19:26 +0400 |
Hi
On Thu, Sep 1, 2022 at 5:00 PM Daniel P. Berrangé <berrange@redhat.com> wrote:
>
> On Thu, Sep 01, 2022 at 03:15:53PM +0400, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Using GLib spawn API is both simpler and portable.
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> > io/channel-command.c | 115 ++++++++-----------------------------------
> > 1 file changed, 21 insertions(+), 94 deletions(-)
>
> > + ioc = qio_channel_command_new_pid(stdinfd,
> > + stdoutfd,
> > +#ifdef _WIN32
> > + GetProcessId(pid)
> > +#else
> > + pid
> > +#endif
> > + );
>
> THe pid parameter is declared as 'pid_t' but GetProcessId returns
> DWORD - are those types guaranteed compatible.
I think pid_t is mingw specific, and is defined as int64.
(windows crt uses int, apparently)
>
> Also the pid passed into qio_channel_command_new_pid is used
> by qio_channel_command_close/abort, to kill off the process,
> but this code is stubbed out in WIN32 and this patch hasn't
> provided an impl.
ok, I'll update the patch and actually test it on win32 too ;)
>
>
> With regards,
> Daniel
> --
> |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o- https://fstop138.berrange.com :|
> |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
>