From a4b85fa73c9ace6b077d9971b34095cfb3a2366c Mon Sep 17 00:00:00 2001 From: Daniel Tartavel Date: Mon, 8 Jun 2020 16:45:24 +0200 Subject: [PATCH] added function name in log --- main.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/main.c b/main.c index c2e2834..5a411fb 100644 --- a/main.c +++ b/main.c @@ -219,6 +219,7 @@ int readconfig( struct config * cfg ) } if (cfg->commande[0] == 0) { + strcpy(cfg->commande,"no command found"); printf("command not found in config file: no command will be executed\n"); retval += 4; } @@ -559,13 +560,8 @@ int main() id=fork(); if(id == 0) { - if (cfg.commande[0] != 0) - { - r = system( str ); - }else - { - printlog("no command defined: no command launched", WARNING, 0); - } + r = system( str ); + printlog("str", WARNING, 0); exit(r); }else if( id<0 ) {