mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-01 15:33:50 +00:00
Fix #781
This commit is contained in:
+13
-10
@@ -1181,16 +1181,6 @@ int main(int argc, char **argv)
|
||||
if (nofile == 0) {
|
||||
nofile = conf->nofile;
|
||||
}
|
||||
/*
|
||||
* no need to check the return value here since we will show
|
||||
* the user an error message if setrlimit(2) fails
|
||||
*/
|
||||
if (nofile > 1024) {
|
||||
if (verbose) {
|
||||
LOGI("setting NOFILE to %d", nofile);
|
||||
}
|
||||
set_nofile(nofile);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1204,6 +1194,19 @@ int main(int argc, char **argv)
|
||||
timeout = "60";
|
||||
}
|
||||
|
||||
#ifdef HAVE_SETRLIMIT
|
||||
/*
|
||||
* no need to check the return value here since we will show
|
||||
* the user an error message if setrlimit(2) fails
|
||||
*/
|
||||
if (nofile > 1024) {
|
||||
if (verbose) {
|
||||
LOGI("setting NOFILE to %d", nofile);
|
||||
}
|
||||
set_nofile(nofile);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (local_addr == NULL) {
|
||||
local_addr = "127.0.0.1";
|
||||
}
|
||||
|
||||
+13
-10
@@ -844,16 +844,6 @@ int main(int argc, char **argv)
|
||||
if (nofile == 0) {
|
||||
nofile = conf->nofile;
|
||||
}
|
||||
/*
|
||||
* no need to check the return value here since we will show
|
||||
* the user an error message if setrlimit(2) fails
|
||||
*/
|
||||
if (nofile > 1024) {
|
||||
if (verbose) {
|
||||
LOGI("setting NOFILE to %d", nofile);
|
||||
}
|
||||
set_nofile(nofile);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -867,6 +857,19 @@ int main(int argc, char **argv)
|
||||
timeout = "60";
|
||||
}
|
||||
|
||||
#ifdef HAVE_SETRLIMIT
|
||||
/*
|
||||
* no need to check the return value here since we will show
|
||||
* the user an error message if setrlimit(2) fails
|
||||
*/
|
||||
if (nofile > 1024) {
|
||||
if (verbose) {
|
||||
LOGI("setting NOFILE to %d", nofile);
|
||||
}
|
||||
set_nofile(nofile);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (local_addr == NULL) {
|
||||
local_addr = "127.0.0.1";
|
||||
}
|
||||
|
||||
+13
-10
@@ -1603,16 +1603,6 @@ int main(int argc, char **argv)
|
||||
if (nofile == 0) {
|
||||
nofile = conf->nofile;
|
||||
}
|
||||
/*
|
||||
* no need to check the return value here since we will show
|
||||
* the user an error message if setrlimit(2) fails
|
||||
*/
|
||||
if (nofile > 1024) {
|
||||
if (verbose) {
|
||||
LOGI("setting NOFILE to %d", nofile);
|
||||
}
|
||||
set_nofile(nofile);
|
||||
}
|
||||
#endif
|
||||
if (conf->nameserver != NULL) {
|
||||
nameservers[nameserver_num++] = conf->nameserver;
|
||||
@@ -1636,6 +1626,19 @@ int main(int argc, char **argv)
|
||||
timeout = "60";
|
||||
}
|
||||
|
||||
#ifdef HAVE_SETRLIMIT
|
||||
/*
|
||||
* no need to check the return value here since we will show
|
||||
* the user an error message if setrlimit(2) fails
|
||||
*/
|
||||
if (nofile > 1024) {
|
||||
if (verbose) {
|
||||
LOGI("setting NOFILE to %d", nofile);
|
||||
}
|
||||
set_nofile(nofile);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pid_flags) {
|
||||
USE_SYSLOG(argv[0]);
|
||||
daemonize(pid_path);
|
||||
|
||||
+13
-10
@@ -890,16 +890,6 @@ int main(int argc, char **argv)
|
||||
if (nofile == 0) {
|
||||
nofile = conf->nofile;
|
||||
}
|
||||
/*
|
||||
* no need to check the return value here since we will show
|
||||
* the user an error message if setrlimit(2) fails
|
||||
*/
|
||||
if (nofile > 1024) {
|
||||
if (verbose) {
|
||||
LOGI("setting NOFILE to %d", nofile);
|
||||
}
|
||||
set_nofile(nofile);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -913,6 +903,19 @@ int main(int argc, char **argv)
|
||||
timeout = "60";
|
||||
}
|
||||
|
||||
#ifdef HAVE_SETRLIMIT
|
||||
/*
|
||||
* no need to check the return value here since we will show
|
||||
* the user an error message if setrlimit(2) fails
|
||||
*/
|
||||
if (nofile > 1024) {
|
||||
if (verbose) {
|
||||
LOGI("setting NOFILE to %d", nofile);
|
||||
}
|
||||
set_nofile(nofile);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (local_addr == NULL) {
|
||||
local_addr = "127.0.0.1";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user