[PATCH 0/1] Don't allow getpgrp() to fail

2019-07-23 Thread Ken Brown
This patch makes getpgrp() conform to POSIX. I have some qualms about it because getpgrp() will now return 0 in cases where it would previously return -1. I don't know if this is likely to break any applications. The patch fixes the problem reported here: https://cygwin.com/ml/cygwin/2019-07/

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

2019-07-23 Thread Ken Brown
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. Change getpgrp() so that it doesn't fail even if getpgid() fails. --- winsup/cygwin/syscalls

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

2019-07-23 Thread Corinna Vinschen
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 proce

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

2019-07-23 Thread Corinna Vinschen
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

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

2019-07-23 Thread Corinna Vinschen
On Jul 23 18:59, Corinna Vinschen wrote: > 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 > > > getpgr

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

2019-07-23 Thread Jon Turney
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.

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

2019-07-23 Thread Corinna Vinschen
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(