summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index b7b2f5cb9..f42c9e126 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -245,10 +245,7 @@ beg:
if (!wait)
set_sig_errno (EAGAIN); /* Don't really need 'set_sig_errno' here, but... */
else
- {
- set_sig_errno (EINTR);
- sawsig = 1;
- }
+ set_sig_errno (EINTR);
res = -1;
goto out;
}
@@ -264,7 +261,7 @@ beg:
}
out:
- if (sawsig && call_signal_handler ())
+ if (res < 0 && get_errno () == EINTR && 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 ());