[PATCH 1/1] Cygwin: don't allow getpgrp() to fail

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Jul 23 19:16:00 GMT 2019


On Jul 23 19:07, Jon Turney wrote:
> On 23/07/2019 17:54, Corinna Vinschen wrote:
> > Hi Ken,
> > 
> > On Jul 23 16:12, Ken Brown wrote:
> > > According to POSIX, "The getpgrp() function shall always be successful
> > > and no return value is reserved to indicate an error."  Cygwin's
> > > getpgrp() is defined in terms of getpgid(), which is allowed to fail.
> > 
> > But it shouldn't fail for the current process.  Why should pinfo::init
> > fail for myself if it begins like this?
> > 
> >    if (myself && n == myself->pid)
> >      {
> >        procinfo = myself;
> >        destroy = 0;
> >        return;
> >      }
> > 
> > I fear this patch would only cover up the problem still persisting
> > under the hood.
> 
> I agree.
> 
> There is presumably a class of programs which require getpgrp() to return
> the correct value for correct operation, which cannot be 0 (since that
> cannot be a pid).

However, did we ever see this problem outside of GDB?


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20190723/06c60472/attachment.sig>


More information about the Cygwin-patches mailing list