diff options
| -rw-r--r-- | src/main.c | 7 |
1 files changed, 7 insertions, 0 deletions
| @@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |||
| 37 | #include <sys/un.h> | 37 | #include <sys/un.h> |
| 38 | #include <sys/stat.h> | 38 | #include <sys/stat.h> |
| 39 | #include <sys/types.h> | 39 | #include <sys/types.h> |
| 40 | #include <sys/resource.h> | ||
| 40 | #include <fcntl.h> | 41 | #include <fcntl.h> |
| 41 | #include <getopt.h> | 42 | #include <getopt.h> |
| 42 | #include <pwd.h> | 43 | #include <pwd.h> |
| @@ -525,6 +526,12 @@ int main(int argc, char *argv[]) | |||
| 525 | goto terminate; | 526 | goto terminate; |
| 526 | } | 527 | } |
| 527 | 528 | ||
| 529 | // set number of file descriptors to higher value | ||
| 530 | struct rlimit rlim; | ||
| 531 | getrlimit(RLIMIT_NOFILE, &rlim); | ||
| 532 | rlim.rlim_max = 65536; | ||
| 533 | setrlimit(RLIMIT_NOFILE, (const struct rlimit*)&rlim); | ||
| 534 | |||
| 528 | usbmuxd_log(LL_INFO, "Creating socket"); | 535 | usbmuxd_log(LL_INFO, "Creating socket"); |
| 529 | res = listenfd = create_socket(); | 536 | res = listenfd = create_socket(); |
| 530 | if(listenfd < 0) | 537 | if(listenfd < 0) |
