struct cli;
extern struct vev_base *mgt_evb;
+extern unsigned d_flag;
/* mgt_child.c */
-void mgt_run(int dflag, const char *T_arg);
+void mgt_run(const char *T_arg);
extern pid_t mgt_pid, child_pid;
void mgt_stop_child(void);
int mgt_cli_askchild(unsigned *status, char **resp, const char *fmt, ...);
void mgt_cli_start_child(int fdi, int fdo);
void mgt_cli_stop_child(void);
-void mgt_cli_telnet(int dflag, const char *T_arg);
+void mgt_cli_telnet(const char *T_arg);
/* mgt_param.c */
void MCF_ParamSync(void);
*/
void
-mgt_run(int dflag, const char *T_arg)
+mgt_run(const char *T_arg)
{
struct sigaction sac;
struct vev *e;
mgt_evb = vev_new_base();
XXXAN(mgt_evb);
- if (dflag)
+ if (d_flag)
mgt_cli_setup(0, 1, 1, "debug");
if (T_arg)
- mgt_cli_telnet(dflag, T_arg);
+ mgt_cli_telnet(T_arg);
e = vev_new();
XXXAN(e);
AZ(sigaction(SIGPIPE, &sac, NULL));
AZ(sigaction(SIGHUP, &sac, NULL));
- if (!dflag && !mgt_has_vcl())
+ if (!d_flag && !mgt_has_vcl())
REPORT0(LOG_ERR, "No VCL loaded yet");
- else if (!dflag) {
+ else if (!d_flag) {
start_child(NULL);
if (child_state == CH_STOPPED)
exit(2);
static void telnet_close_all(void);
static void telnet_close_one(int fd);
-static int dflag_copy;
-
/*--------------------------------------------------------------------*/
static void
(void)close(2);
assert(open("/dev/null", O_WRONLY) == 2);
- if (dflag_copy == 2) {
+ if (d_flag == 2) {
mgt_stop_child();
telnet_close_all();
}
}
void
-mgt_cli_telnet(int dflag, const char *T_arg)
+mgt_cli_telnet(const char *T_arg)
{
struct vss_addr **ta;
char *addr, *port;
int i, n, sock, good;
struct telnet *tn;
- dflag_copy = dflag;
-
XXXAZ(VSS_parse(T_arg, &addr, &port));
n = VSS_resolve(addr, port, &ta);
if (n == 0) {
struct heritage heritage;
volatile struct params *params;
+unsigned d_flag = 0;
/*--------------------------------------------------------------------*/
{
int o;
unsigned C_flag = 0;
- unsigned d_flag = 0;
unsigned F_flag = 0;
const char *b_arg = NULL;
const char *f_arg = NULL;
if (pfh != NULL && vpf_write(pfh))
fprintf(stderr, "NOTE: Could not write PID file\n");
- mgt_run(d_flag, T_arg);
+ mgt_run(T_arg);
if (pfh != NULL)
(void)vpf_remove(pfh);