diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2013-06-11 16:09:42 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2013-06-11 16:09:42 +0400 |
commit | 23ef56423c127464216d534fe12a206c807a53d1 (patch) | |
tree | 549791f2dd706a740822ce85b1f2d9854a04950c /accel-pppd/cli | |
parent | ca0729a15bd271d9cb85c5e493e98d3b5b6f7fea (diff) | |
download | accel-ppp-23ef56423c127464216d534fe12a206c807a53d1.tar.gz accel-ppp-23ef56423c127464216d534fe12a206c807a53d1.zip |
fixed 'restart' commnd (stops all sessions, then do restart)
Diffstat (limited to 'accel-pppd/cli')
-rw-r--r-- | accel-pppd/cli/std_cmd.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/accel-pppd/cli/std_cmd.c b/accel-pppd/cli/std_cmd.c index 38198a2f..84a7711c 100644 --- a/accel-pppd/cli/std_cmd.c +++ b/accel-pppd/cli/std_cmd.c @@ -341,41 +341,37 @@ static void reload_help(char * const *fields, int fields_cnt, void *client) //========================== -static void __do_restart(void) +static void __do_restart1(void) { -#ifdef USE_BACKUP - core_restart(0); -#else core_restart(1); -#endif - _exit(0); } +static void __do_restart0(void) +{ + core_restart(0); +} + + static int restart_exec(const char *cmd, char * const *f, int f_cnt, void *cli) { - int hard = 0; + void (*restart)(void); if (f_cnt == 2) { if (strcmp(f[1], "soft") == 0) - hard = 0; + restart = __do_restart1; else if (strcmp(f[1], "gracefully") == 0) - hard = 1; + restart = __do_restart0; else if (strcmp(f[1], "hard") == 0) - __do_restart(); + core_restart(0); else return CLI_CMD_SYNTAX; } else if (f_cnt == 1) - hard = 0; + restart = __do_restart1; else return CLI_CMD_SYNTAX; - if (hard) { - core_restart(1); - _exit(0); - } else { - ap_shutdown_soft(__do_restart); - terminate_all_sessions(0); - } + ap_shutdown_soft(restart); + terminate_all_sessions(0); return CLI_CMD_OK; } |