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). - todd --- scp.c.DIST Sat Feb 17 17:56:33 2001 +++ scp.c Sat Feb 17 17:57:59 2001 @@ -1224,8 +1224,9 @@ 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 sigaction(SIGALRM, &sa, NULL); alarmtimer(1); --- misc.c.DIST Fri Feb 16 07:58:12 2001 +++ misc.c Sat Feb 17 17:59:53 2001 @@ -108,8 +108,10 @@ memset(&sa, 0, sizeof sa); sigemptyset(&sa.sa_mask); sa.sa_flags = 0; +#ifdef SA_RESTART if (sig == SIGCHLD) sa.sa_flags |= SA_RESTART; +#endif sa.sa_handler = act; if (sigaction(sig, &sa, 0) == -1) return (mysig_t) -1;
I see the misc.c problem has already been fixed. The scp.c one still remains in today's snap. - todd
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
Add unicos to the list of system that don't have SA_RESTART. At 01:05 PM 2/18/01 +1100, Damien Miller wrote:>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