diff --git a/src/fast_ping.c b/src/fast_ping.c index 8e187ad..5e7c810 100644 --- a/src/fast_ping.c +++ b/src/fast_ping.c @@ -1762,6 +1762,8 @@ static void *_fast_ping_work(void *arg) int sleep_time = 0; unsigned long expect_time = 0; + setpriority(PRIO_PROCESS, 0, -5); + sleep_time = sleep; now = get_tick_count() - sleep; last = now; diff --git a/src/smartdns.c b/src/smartdns.c index de2c6c8..f9a056b 100644 --- a/src/smartdns.c +++ b/src/smartdns.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -512,10 +513,21 @@ static int _smartdns_create_logdir(void) return 0; } +static int _set_rlimit(void) +{ + struct rlimit value; + value.rlim_cur = 40; + value.rlim_max = 40; + setrlimit(RLIMIT_NICE, &value); + return 0; +} + static int _smartdns_init_pre(void) { _smartdns_create_logdir(); + _set_rlimit(); + return 0; }