diff options
author | brian <brian@FreeBSD.org> | 1998-06-20 01:36:38 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1998-06-20 01:36:38 +0000 |
commit | c2aa2f38cd437cc848b557b81fe3eb9d4d407b9b (patch) | |
tree | 47845537faee350c8584544d5e7de0f5a6e1537b | |
parent | 6e7ded224d09f6b63debbee1e5db7b1ae4a0a100 (diff) | |
download | FreeBSD-src-c2aa2f38cd437cc848b557b81fe3eb9d4d407b9b.zip FreeBSD-src-c2aa2f38cd437cc848b557b81fe3eb9d4d407b9b.tar.gz |
Re-initialise our timer service after fork()ing
to lose our terminal session. Is this a bug in
setitimer() ? - it must be called again in the
child !
-rw-r--r-- | usr.sbin/ppp/bundle.c | 3 | ||||
-rw-r--r-- | usr.sbin/ppp/timer.c | 9 | ||||
-rw-r--r-- | usr.sbin/ppp/timer.h | 3 |
3 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c index d020db0..49ba4de 100644 --- a/usr.sbin/ppp/bundle.c +++ b/usr.sbin/ppp/bundle.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: bundle.c,v 1.20 1998/06/18 23:38:04 brian Exp $ + * $Id: bundle.c,v 1.21 1998/06/20 00:19:32 brian Exp $ */ #include <sys/param.h> @@ -1634,6 +1634,7 @@ bundle_setsid(struct bundle *bundle, int holdsession) log_Printf(LogPHASE, "%d -> %d: %s session control\n", (int)orig, (int)getpid(), holdsession ? "Passed" : "Dropped"); + timer_InitService(); break; default: close(fds[1]); diff --git a/usr.sbin/ppp/timer.c b/usr.sbin/ppp/timer.c index be8a8b2..f7b4d01 100644 --- a/usr.sbin/ppp/timer.c +++ b/usr.sbin/ppp/timer.c @@ -17,7 +17,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: timer.c,v 1.28 1998/05/21 21:48:46 brian Exp $ + * $Id: timer.c,v 1.29 1998/06/15 19:06:56 brian Exp $ * * TODO: */ @@ -38,7 +38,6 @@ static struct pppTimer *TimerList = NULL; static void StopTimerNoBlock(struct pppTimer *); -static void InitTimerService(void); static const char * tState2Nam(u_int state) @@ -99,7 +98,7 @@ timer_Start(struct pppTimer * tp) if (pt) { pt->next = tp; } else { - InitTimerService(); + timer_InitService(); TimerList = tp; } if (t) @@ -225,8 +224,8 @@ timer_Show(int LogLevel, struct prompt *prompt) log_Printf(LogLevel, "---- End of Timer Service List ---\n"); } -static void -InitTimerService() +void +timer_InitService() { struct itimerval itimer; diff --git a/usr.sbin/ppp/timer.h b/usr.sbin/ppp/timer.h index 0dcca5b..5e6b6be 100644 --- a/usr.sbin/ppp/timer.h +++ b/usr.sbin/ppp/timer.h @@ -15,7 +15,7 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: timer.h,v 1.5.4.5 1998/05/08 01:15:19 brian Exp $ + * $Id: timer.h,v 1.6 1998/05/21 21:48:49 brian Exp $ * * TODO: */ @@ -42,5 +42,6 @@ struct prompt; extern void timer_Start(struct pppTimer *); extern void timer_Stop(struct pppTimer *); +extern void timer_InitService(void); extern void timer_TermService(void); extern void timer_Show(int LogLevel, struct prompt *); |