]> sourceware.org Git - newlib-cygwin.git/commitdiff
* fhandler_tty.cc (fhandler_tty::ioctl): Semi-revert 2003-09-26 change for
authorChristopher Faylor <me@cgf.cx>
Wed, 21 Jan 2004 06:28:35 +0000 (06:28 +0000)
committerChristopher Faylor <me@cgf.cx>
Wed, 21 Jan 2004 06:28:35 +0000 (06:28 +0000)
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.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_tty.cc
winsup/cygwin/sigproc.cc
winsup/cygwin/sigproc.h

index e33b293d2e54a60d2c8ca7f31493b61ec489e906..1ed2d4e7933a88baebda0f2bdbccbf9c86c46747 100644 (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>
 
        * include/cygwin/version.h: Bump DLL minor number to 8.
index 33c7f379daddaea5d51579f1e777538a1fc1373a..4ca8de2694e5a1e7dc4b06284e9f470e9cb07815 100644 (file)
@@ -1,6 +1,6 @@
 /* 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.
 
@@ -1102,17 +1102,19 @@ fhandler_tty_slave::ioctl (unsigned int cmd, void *arg)
       if (get_ttyp ()->winsize.ws_row != ((struct winsize *) arg)->ws_row
          || get_ttyp ()->winsize.ws_col != ((struct winsize *) arg)->ws_col)
        {
-         if (!ioctl_request_event)
-           get_ttyp ()->ioctl_retval = -EINVAL;
-         else
+         get_ttyp ()->arg.winsize = *(struct winsize *) arg;
+         if (ioctl_request_event)
            {
-             get_ttyp ()->arg.winsize = *(struct winsize *) arg;
+             get_ttyp ()->ioctl_retval = -EINVAL;
              SetEvent (ioctl_request_event);
+           }
+         else
+           {
              get_ttyp ()->winsize = *(struct winsize *) arg;
              killsys (-get_ttyp ()->getpgid (), SIGWINCH);
-             if (ioctl_done_event)
-               WaitForSingleObject (ioctl_done_event, INFINITE);
            }
+         if (ioctl_done_event)
+           WaitForSingleObject (ioctl_done_event, INFINITE);
        }
       break;
     case TIOCLINUX:
index 56aa2805b378493021c5a41e18db3dea5e42d97d..6471665bf7dec0182f719d73a8c9bf133eff1d82 100644 (file)
@@ -61,6 +61,8 @@ public:
   void add (sigpacket&);
   void del ();
   sigpacket *next ();
+  sigpacket *save () const {return curr;}
+  void restore (sigpacket *saved) {curr = saved;}
   friend int __stdcall sig_dispatch_pending ();
 };
 
@@ -543,14 +545,16 @@ sig_clear (int target_sig)
     sig_send (myself, -target_sig);
   else
     {
-      sigqueue.reset ();
       sigpacket *q;
+      sigpacket *save = sigqueue.save ();
+      sigqueue.reset ();
       while ((q = sigqueue.next ()))
        if (q->si.si_signo == target_sig)
          {
-           sigqueue.del ();
+           q->si.si_signo = __SIGDELETE;
            break;
          }
+      sigqueue.restore (save);
     }
   return;
 }
@@ -1166,7 +1170,7 @@ wait_sig (VOID *self)
        case __SIGFLUSH:
          sigqueue.reset ();
          while ((q = sigqueue.next ()))
-           if (q->process () > 0)
+           if (q->si.si_signo == __SIGDELETE || q->process () > 0)
              sigqueue.del ();
          break;
        default:
index 03ee1b89b1f8bde0447c59d336ea26e2e0f20d1c..9c9608901801b0b5fb162bf1d3b02dcbd4f4c607 100644 (file)
@@ -22,7 +22,8 @@ enum
   __SIGFLUSH       = -(NSIG + 1),
   __SIGSTRACE      = -(NSIG + 2),
   __SIGCOMMUNE     = -(NSIG + 3),
-  __SIGPENDING     = -(NSIG + 4)
+  __SIGPENDING     = -(NSIG + 4),
+  __SIGDELETE      = -(NSIG + 5)
 };
 #endif
 
This page took 0.035617 seconds and 5 git commands to generate.