Skip to content

Commit

Permalink
Move debug determination logic so it happens before first debug
Browse files Browse the repository at this point in the history
statement
  • Loading branch information
awiddersheim committed Jan 29, 2014
1 parent 7f7ffa2 commit c96a8ce
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/client-agent/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,29 +83,27 @@ int main(int argc, char **argv)
}
}

debug1(STARTED_MSG, ARGV0);

logr = (agent *)calloc(1, sizeof(agent));
if(!logr)
{
ErrorExit(MEM_ERROR, ARGV0);
}


/* Check current debug_level
* Command line setting takes precedence
*/
if (debug_level == 0)
{
/* Getting debug level */
debug_level = getDefine_Int("agent","debug", 0, 2);
debug_level = getDefine_Int("agent", "debug", 0, 2);
while(debug_level != 0)
{
nowDebug();
debug_level--;
}
}

debug1(STARTED_MSG, ARGV0);

logr = (agent *)calloc(1, sizeof(agent));
if(!logr)
{
ErrorExit(MEM_ERROR, ARGV0);
}

/* Reading config */
if(ClientConf(DEFAULTCPATH) < 0)
Expand Down

0 comments on commit c96a8ce

Please sign in to comment.