This is the mail archive of the cygwin-patches mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

On Jul 23 18: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.
> > Change getpgrp() so that it doesn't fail even if getpgid() fails.
> Instead of calling getpgid(0), we could just as well return
> myself->pgid.  This never fails for sure.

Just a hunch: The only reason for pinfo::init failing in GDB I can think
of is if the call is too early in the lifetime of the process.  Myself
might not be set up yet.


Corinna Vinschen
Cygwin Maintainer

Attachment: signature.asc
Description: PGP signature

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]