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 !
This commit is contained in:
brian 1998-06-20 01:36:38 +00:00
parent 6e7ded224d
commit c2aa2f38cd
3 changed files with 8 additions and 7 deletions

View File

@ -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]);

View File

@ -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;

View File

@ -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 *);