From f8b8426686db1208099c3423ce038d3007aeb47c Mon Sep 17 00:00:00 2001 From: hev Date: Wed, 22 Mar 2023 13:40:18 +0800 Subject: [PATCH] HevMain: Fix run as daemon. --- src/hev-main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hev-main.c b/src/hev-main.c index 5f9fea0..6ba428b 100644 --- a/src/hev-main.c +++ b/src/hev-main.c @@ -93,6 +93,10 @@ main (int argc, char *argv[]) if (res < 0) return -4; + pid_file = hev_config_get_misc_pid_file (); + if (pid_file) + run_as_daemon (pid_file); + res = hev_socks5_tproxy_init (); if (res < 0) return -5; @@ -102,10 +106,6 @@ main (int argc, char *argv[]) if (res < 0) LOG_W ("set limit nofile"); - pid_file = hev_config_get_misc_pid_file (); - if (pid_file) - run_as_daemon (pid_file); - hev_socks5_tproxy_run (); hev_socks5_tproxy_fini ();