* fhandler_tty.cc (fhandler_tty::ioctl): Semi-revert 2003-09-26 change for

TIOCSWINSZ.  It is not an error for ioctl_request_event to be missing.
* sigproc.cc (pending_signals::save): New function.
(pending_signals::restore): Ditto.
(sig_clear): Save/restore current queue pointer.
(wait_sig): Delete signals marked as such.
* sigproc.h (__SIGDELETE): New enum.
This commit is contained in:
Christopher Faylor 2004-01-21 06:28:35 +00:00
parent 1284fa137f
commit bcb4223cbc
4 changed files with 32 additions and 11 deletions

View File

@ -1,3 +1,17 @@
2004-01-21 Christopher Faylor <cgf@redhat.com>
* fhandler_tty.cc (fhandler_tty::ioctl): Semi-revert 2003-09-26 change
for TIOCSWINSZ. It is not an error for ioctl_request_event to be
missing.
2004-01-20 Christopher Faylor <cgf@redhat.com>
* sigproc.cc (pending_signals::save): New function.
(pending_signals::restore): Ditto.
(sig_clear): Save/restore current queue pointer.
(wait_sig): Delete signals marked as such.
* sigproc.h (__SIGDELETE): New enum.
2004-01-20 Christopher Faylor <cgf@redhat.com> 2004-01-20 Christopher Faylor <cgf@redhat.com>
* include/cygwin/version.h: Bump DLL minor number to 8. * include/cygwin/version.h: Bump DLL minor number to 8.

View File

@ -1,6 +1,6 @@
/* fhandler_tty.cc /* fhandler_tty.cc
Copyright 1997, 1998, 2000, 2001, 2002, 2003 Red Hat, Inc. Copyright 1997, 1998, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
This file is part of Cygwin. This file is part of Cygwin.
@ -1102,17 +1102,19 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg)
if (get_ttyp ()->winsize.ws_row != ((struct winsize *) arg)->ws_row if (get_ttyp ()->winsize.ws_row != ((struct winsize *) arg)->ws_row
|| get_ttyp ()->winsize.ws_col != ((struct winsize *) arg)->ws_col) || get_ttyp ()->winsize.ws_col != ((struct winsize *) arg)->ws_col)
{ {
if (!ioctl_request_event) get_ttyp ()->arg.winsize = *(struct winsize *) arg;
get_ttyp ()->ioctl_retval = -EINVAL; if (ioctl_request_event)
{
get_ttyp ()->ioctl_retval = -EINVAL;
SetEvent (ioctl_request_event);
}
else else
{ {
get_ttyp ()->arg.winsize = *(struct winsize *) arg;
SetEvent (ioctl_request_event);
get_ttyp ()->winsize = *(struct winsize *) arg; get_ttyp ()->winsize = *(struct winsize *) arg;
killsys (-get_ttyp ()->getpgid (), SIGWINCH); killsys (-get_ttyp ()->getpgid (), SIGWINCH);
if (ioctl_done_event)
WaitForSingleObject (ioctl_done_event, INFINITE);
} }
if (ioctl_done_event)
WaitForSingleObject (ioctl_done_event, INFINITE);
} }
break; break;
case TIOCLINUX: case TIOCLINUX:

View File

@ -61,6 +61,8 @@ public:
void add (sigpacket&); void add (sigpacket&);
void del (); void del ();
sigpacket *next (); sigpacket *next ();
sigpacket *save () const {return curr;}
void restore (sigpacket *saved) {curr = saved;}
friend int __stdcall sig_dispatch_pending (); friend int __stdcall sig_dispatch_pending ();
}; };
@ -543,14 +545,16 @@ sig_clear (int target_sig)
sig_send (myself, -target_sig); sig_send (myself, -target_sig);
else else
{ {
sigqueue.reset ();
sigpacket *q; sigpacket *q;
sigpacket *save = sigqueue.save ();
sigqueue.reset ();
while ((q = sigqueue.next ())) while ((q = sigqueue.next ()))
if (q->si.si_signo == target_sig) if (q->si.si_signo == target_sig)
{ {
sigqueue.del (); q->si.si_signo = __SIGDELETE;
break; break;
} }
sigqueue.restore (save);
} }
return; return;
} }
@ -1166,7 +1170,7 @@ wait_sig (VOID *self)
case __SIGFLUSH: case __SIGFLUSH:
sigqueue.reset (); sigqueue.reset ();
while ((q = sigqueue.next ())) while ((q = sigqueue.next ()))
if (q->process () > 0) if (q->si.si_signo == __SIGDELETE || q->process () > 0)
sigqueue.del (); sigqueue.del ();
break; break;
default: default:

View File

@ -22,7 +22,8 @@ enum
__SIGFLUSH = -(NSIG + 1), __SIGFLUSH = -(NSIG + 1),
__SIGSTRACE = -(NSIG + 2), __SIGSTRACE = -(NSIG + 2),
__SIGCOMMUNE = -(NSIG + 3), __SIGCOMMUNE = -(NSIG + 3),
__SIGPENDING = -(NSIG + 4) __SIGPENDING = -(NSIG + 4),
__SIGDELETE = -(NSIG + 5)
}; };
#endif #endif