diff options
-rw-r--r-- | common/smtppass.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/common/smtppass.c b/common/smtppass.c index 550484d..6897aaa 100644 --- a/common/smtppass.c +++ b/common/smtppass.c @@ -290,6 +290,13 @@ int sp_run(const char* configfile, const char* pidfile, int dbg_level) if(bind(sock, &SANY_ADDR(g_state.listenaddr), SANY_LEN(g_state.listenaddr)) != 0) err(1, "couldn't bind to address: %s", g_state.listenname); + /* Let 5 connections queue up */ + if(listen(sock, 5) != 0) + { + sp_message(NULL, LOG_CRIT, "couldn't listen on socket"); + exit(1); + } + /* Drop privileges before daemonizing */ drop_privileges(); @@ -310,13 +317,6 @@ int sp_run(const char* configfile, const char* pidfile, int dbg_level) openlog(g_state.name, 0, LOG_MAIL); } - /* Let 5 connections queue up */ - if(listen(sock, 5) != 0) - { - sp_message(NULL, LOG_CRIT, "couldn't listen on socket"); - exit(1); - } - sp_messagex(NULL, LOG_DEBUG, "created socket: %s", g_state.listenname); /* Handle some signals */ |