From: Ian Jackson Date: Sun, 17 Jul 2022 12:17:04 +0000 (+0100) Subject: prefork: Provide PREFORK_CMDINFOS X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=chiark-utils.git;a=commitdiff_plain;h=8a481ab505568926f3fe8cded0a9752b8acf5593 prefork: Provide PREFORK_CMDINFOS Signed-off-by: Ian Jackson --- diff --git a/cprogs/cgi-fcgi-interp.c b/cprogs/cgi-fcgi-interp.c index 7ed5625..3dbfef6 100644 --- a/cprogs/cgi-fcgi-interp.c +++ b/cprogs/cgi-fcgi-interp.c @@ -139,10 +139,7 @@ static int numservers=4, debugmode; static int check_interval=300; const struct cmdinfo cmdinfos[]= { - { "help", 0, .call=of_help }, - { 0, 'g', 1, .sassignto= &ident }, - { 0, 'G', 1, .call= ident_addstring }, - { 0, 'E', 1, .call= off_ident_addenv }, + PREFORK_CMDINFOS { 0, 'M', 1, .call=of_iassign, .iassignto= &numservers }, { 0, 'D', 0, .iassignto= &debugmode, .arg= 1 }, { 0, 'c', 1, .call=of_iassign, .iassignto= &check_interval }, diff --git a/cprogs/prefork.h b/cprogs/prefork.h index 19c3bc1..a2ad102 100644 --- a/cprogs/prefork.h +++ b/cprogs/prefork.h @@ -46,6 +46,11 @@ void find_socket_path(void); int acquire_lock(void); extern const struct cmdinfo cmdinfos[]; +#define PREFORK_CMDINFOS \ + { "help", 0, .call=of_help }, \ + { 0, 'g', 1, .sassignto= &ident }, \ + { 0, 'G', 1, .call= ident_addstring }, \ + { 0, 'E', 1, .call= off_ident_addenv }, void process_opts(const char *const **argv_io);