public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* grantpt, unlockpt bug
@ 2011-09-21 13:27 Eric Blake
  2011-09-21 20:43 ` Christopher Faylor
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Blake @ 2011-09-21 13:27 UTC (permalink / raw)
  To: cygwin

Bruno Haible reported that grantpt and unlockpt report success even on 
invalid fds.  This program fails the assertion at line 7:

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
int main (void)
{
   assert (grantpt (-1) == -1);
   assert (errno == EBADF);
   errno = 0;
   assert (grantpt (99) == -1);
   assert (errno == EBADF);
   return 0;
}

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: grantpt, unlockpt bug
  2011-09-21 13:27 grantpt, unlockpt bug Eric Blake
@ 2011-09-21 20:43 ` Christopher Faylor
  0 siblings, 0 replies; 2+ messages in thread
From: Christopher Faylor @ 2011-09-21 20:43 UTC (permalink / raw)
  To: cygwin

On Tue, Sep 20, 2011 at 04:45:42PM -0600, Eric Blake wrote:
>Bruno Haible reported that grantpt and unlockpt report success even on 
>invalid fds.  This program fails the assertion at line 7:
>
>#include <errno.h>
>#include <stdio.h>
>#include <stdlib.h>
>#include <assert.h>
>int main (void)
>{
>   assert (grantpt (-1) == -1);
>   assert (errno == EBADF);
>   errno = 0;
>   assert (grantpt (99) == -1);
>   assert (errno == EBADF);
>   return 0;
>}

I checked in a simple fix for this.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-21  4:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-21 13:27 grantpt, unlockpt bug Eric Blake
2011-09-21 20:43 ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).