mirror of https://github.com/ossrs/srs.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
593 B
Diff
20 lines
593 B
Diff
*** io.c Fri Oct 2 06:49:07 2009
|
|
--- ../st-1.9-patch/io.c Mon Mar 16 15:06:28 2015
|
|
***************
|
|
*** 89,94 ****
|
|
--- 89,102 ----
|
|
if (fdlim > 0 && rlim.rlim_max > (rlim_t) fdlim) {
|
|
rlim.rlim_max = fdlim;
|
|
}
|
|
+
|
|
+ /* when rlimit max is negative, for example, osx, use cur directly. */
|
|
+ /* @see https://github.com/winlinvip/simple-rtmp-server/issues/336 */
|
|
+ if ((int)rlim.rlim_max < 0) {
|
|
+ _st_osfd_limit = (int)(fdlim > 0? fdlim : rlim.rlim_cur);
|
|
+ return 0;
|
|
+ }
|
|
+
|
|
rlim.rlim_cur = rlim.rlim_max;
|
|
if (setrlimit(RLIMIT_NOFILE, &rlim) < 0)
|
|
return -1;
|