guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Support open-process and friends on MS-Windows


From: Eli Zaretskii
Subject: Re: Support open-process and friends on MS-Windows
Date: Fri, 24 Jun 2016 16:25:05 +0300

> From: address@hidden (Ludovic Courtès)
> Cc: Andy Wingo <address@hidden>,  address@hidden
> Date: Fri, 24 Jun 2016 13:49:17 +0200
> 
> > diff --git a/libguile/posix.c b/libguile/posix.c
> > index 2654716..35b920f 100644
> > --- a/libguile/posix.c
> > +++ b/libguile/posix.c
> > @@ -84,6 +84,10 @@
> >  #if HAVE_SYS_WAIT_H
> >  # include <sys/wait.h>
> >  #endif
> > +#ifdef __MINGW32__
> > +# include "w32-proc.c"
> > +#endif     /* __MINGW32__ */
> 
> I’d have a slight preference for using AC_LIBSOURCE or a Makefile.am
> snippet to compile w32-proc.c separately (which means w32-proc.h should
> be added to provide declarations).

I'm not much of an expert on autotools, so I preferred to do this the
way I can understand and convince myself the code is correct.  I don't
mind to doing that your way, of course, but I'd prefer that someone
else does the refactoring, if possible.

> However this shouldn’t be a blocker (if the current approach is kept,
> use <w32-proc.c> rather than "w32-proc.c").

Great!

> > +#ifdef __MINGW32__
> > +  else
> > +    {
> > +      HANDLE ph = OpenProcess (PROCESS_TERMINATE, 0, scm_to_int (pid));
> > +      int s = scm_to_int (sig);
> > +
> > +      if (!ph)
> > +   {
> > +     errno = EPERM;
> > +     goto err;
> > +   }
> > +      if (!TerminateProcess (ph, w32_signal_to_status (s)))
> > +   {
> > +     errno = EINVAL;
> > +     goto err;
> > +   }
> > +      CloseHandle (ph);
> > +    }
> > +#endif     /* __MINGW32__ */
> >  #endif
> >    return SCM_UNSPECIFIED;
> 
> For consistency maybe this should go in a ‘kill’ function in w32-proc.c?

I can do that.  It's just that I thought such a short code fragment
doesn't need that, but I don't mind.

> Thanks a lot for taking the time to update the patch, and for forgiving
> our failure to handle it earlier.

Thanks for giving me another chance to submit this.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]