1
0

added function name in log

This commit is contained in:
Daniel Tartavel 2020-06-08 16:45:24 +02:00
parent 94198e6a25
commit a4b85fa73c

10
main.c
View File

@ -219,6 +219,7 @@ int readconfig( struct config * cfg )
} }
if (cfg->commande[0] == 0) if (cfg->commande[0] == 0)
{ {
strcpy(cfg->commande,"no command found");
printf("command not found in config file: no command will be executed\n"); printf("command not found in config file: no command will be executed\n");
retval += 4; retval += 4;
} }
@ -559,13 +560,8 @@ int main()
id=fork(); id=fork();
if(id == 0) if(id == 0)
{ {
if (cfg.commande[0] != 0) r = system( str );
{ printlog("str", WARNING, 0);
r = system( str );
}else
{
printlog("no command defined: no command launched", WARNING, 0);
}
exit(r); exit(r);
}else if( id<0 ) }else if( id<0 )
{ {