summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-01-17 14:57:09 +0000
committerChristopher Faylor <me@cgf.cx>2001-01-17 14:57:09 +0000
commita7cde2b98a658522f552a7ac7ae0a9ef07981e0a (patch)
tree09134d68cc17eab1ebd6c4d81363c189f70ddf7c /winsup/cygwin/syscalls.cc
parentcb503978ab5119740bc5e796344db6a5d0e6bcb5 (diff)
downloadcygnal-a7cde2b98a658522f552a7ac7ae0a9ef07981e0a.tar.gz
cygnal-a7cde2b98a658522f552a7ac7ae0a9ef07981e0a.tar.bz2
cygnal-a7cde2b98a658522f552a7ac7ae0a9ef07981e0a.zip
* autoload.cc (LoadDLLinitfunc): Remove debugging statement.
* exceptions.cc (sig_handle_tty_stop): Move setting of PID_STOPPED to earlier in interrupt. ((interrupt_setup): i.e., here. (sig_handle): Don't queue multiple SIGSTOPS. * fhandler.h (bg_check_types): Enumerate return value of bg_check for clarity. * signal.cc (kill_pgrp): Minor cleanup. * fhandler_termios.cc (fhandler_termios::bg_check): Use enumerated type for function return. Don't raise signal if a signal is already queued. * fhandler_console.cc (fhandler_console::read): Use enumerated return type for bg_check. * select.cc: Ditto, throughout. * read.cc: Ditto, throughout. * termios.cc: Ditto, throughout. (_read): YA interrupt detect simplification. * wait.cc (wait4): Ditto.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 71869cfc5..08e99cd1b 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1,6 +1,6 @@
/* syscalls.cc: syscalls
- Copyright 1996, 1997, 1998, 1999, 2000 Cygnus Solutions.
+ Copyright 1996, 1997, 1998, 1999, 2000, 2001 Red Hat, Inc.
This file is part of Cygwin.
@@ -220,8 +220,10 @@ _read (int fd, void *ptr, size_t len)
{
sigframe thisframe (mainthread);
extern int sigcatchers;
+ bool sawsig;
beg:
+ sawsig = 0;
if (fdtab.not_open (fd))
{
set_errno (EBADF);
@@ -243,7 +245,10 @@ beg:
if (!wait)
set_sig_errno (EAGAIN); /* Don't really need 'set_sig_errno' here, but... */
else
- set_sig_errno (EINTR);
+ {
+ set_sig_errno (EINTR);
+ sawsig = 1;
+ }
res = -1;
goto out;
}
@@ -251,7 +256,7 @@ beg:
/* Check to see if this is a background read from a "tty",
sending a SIGTTIN, if appropriate */
res = fh->bg_check (SIGTTIN);
- if (res > 0)
+ if (res > bg_eof)
{
myself->process_state |= PID_TTYIN;
res = fh->read (ptr, len);
@@ -259,7 +264,7 @@ beg:
}
out:
- if (res < 0 && get_errno () == EINTR && call_signal_handler ())
+ if (sawsig && call_signal_handler ())
goto beg;
syscall_printf ("%d = read (%d<%s>, %p, %d), bin %d, errno %d", res, fd, fh->get_name (),
ptr, len, fh->get_r_binary (), get_errno ());
@@ -289,7 +294,7 @@ _write (int fd, const void *ptr, size_t len)
fh = fdtab[fd];
res = fh->bg_check (SIGTTOU);
- if (res > 0)
+ if (res > bg_eof)
{
myself->process_state |= PID_TTYOU;
res = fh->write (ptr, len);