diff options
| author | dequis <dx@dxzone.com.ar> | 2016-05-01 00:27:28 -0300 | 
|---|---|---|
| committer | dequis <dx@dxzone.com.ar> | 2016-05-01 00:27:28 -0300 | 
| commit | 72d48b67c9c3f1b440c943a7e30523c9bce25f3c (patch) | |
| tree | 474ff9ff2198edfca63619bf79926271608fe5eb | |
| parent | 720f7a9434d30c3fa41544c3e6f0f00f3c348a5c (diff) | |
unix.c: Move log_link() calls before plugin initialization
This ensures that plugin load errors are logged instead of thrown away
| -rw-r--r-- | unix.c | 17 | 
1 files changed, 8 insertions, 9 deletions
| @@ -79,6 +79,14 @@ int main(int argc, char *argv[])  		return(1);  	} +	if (global.conf->runmode == RUNMODE_INETD) { +		log_link(LOGLVL_ERROR, LOGOUTPUT_IRC); +		log_link(LOGLVL_WARNING, LOGOUTPUT_IRC); +	} else { +		log_link(LOGLVL_ERROR, LOGOUTPUT_CONSOLE); +		log_link(LOGLVL_WARNING, LOGOUTPUT_CONSOLE); +	} +  	b_main_init();  	/* libpurple doesn't like fork()s after initializing itself, so if @@ -110,22 +118,13 @@ int main(int argc, char *argv[])  	}  	if (global.conf->runmode == RUNMODE_INETD) { -		log_link(LOGLVL_ERROR, LOGOUTPUT_IRC); -		log_link(LOGLVL_WARNING, LOGOUTPUT_IRC); -  		i = bitlbee_inetd_init();  		log_message(LOGLVL_INFO, "%s %s starting in inetd mode.", PACKAGE, BITLBEE_VERSION);  	} else if (global.conf->runmode == RUNMODE_DAEMON) { -		log_link(LOGLVL_ERROR, LOGOUTPUT_CONSOLE); -		log_link(LOGLVL_WARNING, LOGOUTPUT_CONSOLE); -  		i = bitlbee_daemon_init();  		log_message(LOGLVL_INFO, "%s %s starting in daemon mode.", PACKAGE, BITLBEE_VERSION);  	} else if (global.conf->runmode == RUNMODE_FORKDAEMON) { -		log_link(LOGLVL_ERROR, LOGOUTPUT_CONSOLE); -		log_link(LOGLVL_WARNING, LOGOUTPUT_CONSOLE); -  		/* In case the operator requests a restart, we need this. */  		old_cwd = g_malloc(256);  		if (getcwd(old_cwd, 255) == NULL) { | 
