OpenSSH 2.5.0p1 vs. SA_RESTART
Damien Miller
djm at mindrot.org
Sun Feb 18 13:05:01 EST 2001
On Sat, 17 Feb 2001, Todd C. Miller wrote:
> Not all OSes have SA_RESTART (for instance, SunOS does not).
> Also, for the non-SA_RESTART case in scp.c sa.sa_flags
> was not being initialized (noted by dworkin at village.org).
Can you give this a try? It uses SA_INTERRUPT, my copy of Stevens
tells me this does the same thing on SunOS.
Index: misc.c
===================================================================
RCS file: /var/cvs/openssh/misc.c,v
retrieving revision 1.9
diff -u -r1.9 misc.c
--- misc.c 2001/02/17 17:10:16 1.9
+++ misc.c 2001/02/18 02:03:36
@@ -112,6 +112,10 @@
if (sig == SIGCHLD)
sa.sa_flags |= SA_RESTART;
#endif
+#ifdef SA_INTERRUPT
+ if (sig == SIGCHLD)
+ sa.sa_flags |= SA_INTERRUPT;
+#endif
sa.sa_handler = act;
if (sigaction(sig, &sa, NULL) == -1)
return (mysig_t) -1;
Index: scp.c
===================================================================
RCS file: /var/cvs/openssh/scp.c,v
retrieving revision 1.54
diff -u -r1.54 scp.c
--- scp.c 2001/02/11 14:19:40 1.54
+++ scp.c 2001/02/18 02:03:36
@@ -1224,8 +1224,12 @@
struct sigaction sa;
sa.sa_handler = updateprogressmeter;
sigemptyset((sigset_t *)&sa.sa_mask);
+ sa.sa_flags = 0;
#ifdef SA_RESTART
- sa.sa_flags = SA_RESTART;
+ sa.sa_flags |= SA_RESTART;
+#endif
+#ifdef SA_INTERRUPT
+ sa.sa_flags |= SA_INTERRUPT;
#endif
sigaction(SIGALRM, &sa, NULL);
alarmtimer(1);
-d
--
| Damien Miller <djm at mindrot.org> \ ``E-mail attachments are the poor man's
| http://www.mindrot.org / distributed filesystem'' - Dan Geer
More information about the openssh-unix-dev
mailing list