From bf8558bc9cab35f31bccd6a55e51f121370765c4 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sun, 16 Jan 2000 17:40:26 +0000 Subject: Converted shutdown to a kind of reconfiguration, it's no more handled as a exception in protocol state machines. Introduced a `shutdown' CLI command. Killed few reconfiguration bugs. --- conf/conf.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'conf/conf.h') diff --git a/conf/conf.h b/conf/conf.h index 7d13ae9..9fe133e 100644 --- a/conf/conf.h +++ b/conf/conf.h @@ -27,6 +27,7 @@ struct config { struct symbol **sym_hash; /* Lexer: symbol hash table */ struct symbol **sym_fallback; /* Lexer: fallback symbol hash table */ int obstacle_count; /* Number of items blocking freeing of this config */ + int shutdown; /* This is a pseudo-config for daemon shutdown */ }; /* Please don't use these variables in protocols. Use proto_config->global instead. */ @@ -35,6 +36,8 @@ extern struct config *new_config; /* Configuration being parsed */ extern struct config *old_config; /* Old configuration when reconfiguration is in progress */ extern struct config *future_config; /* New config held here if recon requested during recon */ +extern int shutting_down; + struct config *config_alloc(byte *name); int config_parse(struct config *); int cli_parse(struct config *); @@ -43,10 +46,12 @@ int config_commit(struct config *); void cf_error(char *msg, ...) NORET; void config_add_obstacle(struct config *); void config_del_obstacle(struct config *); +void order_shutdown(void); #define CONF_DONE 0 #define CONF_PROGRESS 1 #define CONF_QUEUED 2 +#define CONF_SHUTDOWN 3 /* Pools */ @@ -98,5 +103,6 @@ int cf_parse(void); void sysdep_preconfig(struct config *); int sysdep_commit(struct config *, struct config *); +void sysdep_shutdown_done(void); #endif -- cgit v1.2.3