From 2dbc2c541bb0918487be595d13efe6981124c18e Mon Sep 17 00:00:00 2001 From: Kouhei Sutou Date: Thu, 3 Oct 2013 17:11:12 +0900 Subject: [PATCH] Remove a restriction related to RLIMIT_NOFILE on HTTP server GQTP server can use 4096 over RLIMIT_NOFILE but HTTP server couldn't. --- src/groonga.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/groonga.c b/src/groonga.c index c9fe0d0aef..1d66bcffe6 100644 --- a/src/groonga.c +++ b/src/groonga.c @@ -1431,20 +1431,7 @@ h_server(char *path) CRITICAL_SECTION_INIT(cache_lock); GRN_COM_QUEUE_INIT(&ctx_new); GRN_COM_QUEUE_INIT(&ctx_old); -#ifndef WIN32 - { - struct rlimit lim; - lim.rlim_cur = 4096; - lim.rlim_max = 4096; - /* RLIMIT_OFILE */ - setrlimit(RLIMIT_NOFILE, &lim); - lim.rlim_cur = 0; - lim.rlim_max = 0; - getrlimit(RLIMIT_NOFILE, &lim); - GRN_LOG(ctx, GRN_LOG_NOTICE, "RLIMIT_NOFILE(%" GRN_FMT_LLD ",%" GRN_FMT_LLD ")", - (long long int)lim.rlim_cur, (long long int)lim.rlim_max); - } -#endif /* WIN32 */ + check_rlimit_nofile(ctx); exit_code = start_service(ctx, path, NULL, h_handler); grn_ctx_fin(ctx); return exit_code;