1 --- main.c 2014-08-20 09:45:52.585530000 -0700
2 +++ main.c 2014-08-22 11:29:54.792973000 -0700
4 char warn_f_flag = '\0';
5 bool run_in_foreground = false; /* -bD mode */
6 bool queuerun = false, debug = false;
7 + bool queueintvl = false;
10 char *nullserver = NULL;
13 /* just check if it is there */
22 macdefine(&BlankEnvelope.e_macro, A_PERM, 'v', Version);
25 + * We have to fork early if starting as a daemon to
26 + * prevent resolver lookup problems (e.g. no net available)
27 + * from stalling the rc boot.
29 + if (OpMode == MD_DAEMON || queueintvl == true) {
30 + /* put us in background */
33 + syserr("daemon: cannot fork");
36 + finis(false, true, EX_OK);
39 + disconnect(2, CurEnv);
40 + CurrentPid = getpid();
44 hp = myhostname(jbuf, sizeof(jbuf));
47 ** doing it in background.
48 ** We check for any errors that might have happened
50 + ** We have ALREADY forked if a daemon.
53 if (OpMode == MD_DAEMON || QueueIntvl > 0)
56 if (!run_in_foreground && !tTd(99, 100))
59 /* put us in background */
63 finis(false, true, EX_OK);
69 ** Initialize exception stack and default exception
70 @@ -2563,9 +2588,12 @@
71 macdefine(&BlankEnvelope.e_macro, A_TEMP, '_', authinfo);
73 /* at this point we are in a child: reset state */
74 - sm_rpool_free(MainEnvelope.e_rpool);
75 - (void) newenvelope(&MainEnvelope, &MainEnvelope,
76 - sm_rpool_new_x(NULL));
78 + SM_RPOOL_T *opool = MainEnvelope.e_rpool;
79 + (void) newenvelope(&MainEnvelope, &MainEnvelope,
80 + sm_rpool_new_x(NULL));
81 + sm_rpool_free(opool);