struct cli;
extern struct vev_base *mgt_evb;
-extern unsigned d_flag;
+extern unsigned d_flag;
+extern pid_t mgt_pid;
/* mgt_child.c */
-void mgt_run(const char *T_arg);
-extern pid_t mgt_pid, child_pid;
+extern pid_t child_pid;
+void MGT_Run(void);
void mgt_stop_child(void);
/* mgt_cli.c */
#include "vss.h"
#include "vbm.h"
-pid_t mgt_pid;
pid_t child_pid = -1;
static struct vbitmap *fd_map;
[CH_DIED] = "died, (restarting)",
};
-struct vev_base *mgt_evb;
static struct vev *ev_poker;
static struct vev *ev_listen;
static struct vlu *vlu;
*/
void
-mgt_run(const char *T_arg)
+MGT_Run(void)
{
struct sigaction sac;
struct vev *e;
int i;
- mgt_pid = getpid();
-
- mgt_evb = vev_new_base();
- XXXAN(mgt_evb);
-
- if (d_flag)
- mgt_cli_setup(0, 1, 1, "debug");
-
- if (T_arg)
- mgt_cli_telnet(T_arg);
-
e = vev_new();
XXXAN(e);
e->sig = SIGTERM;
#endif
#include "vsb.h"
+#include "vev.h"
#include "vpf.h"
#include "vsha256.h"
#define INFTIM -1
#endif
-struct heritage heritage;
-volatile struct params *params;
-unsigned d_flag = 0;
+struct heritage heritage;
+volatile struct params *params;
+unsigned d_flag = 0;
+pid_t mgt_pid;
+struct vev_base *mgt_evb;
+
+
/*--------------------------------------------------------------------*/
if (pfh != NULL && vpf_write(pfh))
fprintf(stderr, "NOTE: Could not write PID file\n");
- mgt_run(T_arg);
+ mgt_pid = getpid();
+
+ mgt_evb = vev_new_base();
+ XXXAN(mgt_evb);
+
+ if (d_flag)
+ mgt_cli_setup(0, 1, 1, "debug");
+ if (T_arg)
+ mgt_cli_telnet(T_arg);
+
+ MGT_Run();
if (pfh != NULL)
(void)vpf_remove(pfh);