Skip to content

Commit

Permalink
HevMain: Fix run as daemon.
Browse files Browse the repository at this point in the history
  • Loading branch information
heiher committed Mar 22, 2023
1 parent 2a8c3ff commit f8b8426
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hev-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 ();
Expand Down

0 comments on commit f8b8426

Please sign in to comment.