Mercurial > dovecot > original-hg > dovecot-1.2
changeset 6395:1622e332c8ae HEAD
Removed restrict_raise_fd_limit().
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sat, 15 Sep 2007 16:57:11 +0300 |
parents | 9e74c008484a |
children | 1b21dfee7bd7 |
files | src/lib/restrict-process-size.c src/lib/restrict-process-size.h |
diffstat | 2 files changed, 0 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib/restrict-process-size.c Sat Sep 15 15:58:27 2007 +0300 +++ b/src/lib/restrict-process-size.c Sat Sep 15 16:57:11 2007 +0300 @@ -53,26 +53,3 @@ i_fatal("setrlimit(RLIMIT_NOFILE, %u): %m", count); #endif } - -bool restrict_raise_fd_limit(unsigned int count) -{ -#ifdef HAVE_SETRLIMIT - struct rlimit rlim, new_rlim; - - if (getrlimit(RLIMIT_NOFILE, &rlim) < 0) - return FALSE; - if (rlim.rlim_cur >= count) - return TRUE; - - new_rlim.rlim_cur = new_rlim.rlim_max = count; - if (setrlimit(RLIMIT_NOFILE, &new_rlim) == 0) - return TRUE; - - /* raise as high as we can */ - if (rlim.rlim_cur < rlim.rlim_max) { - rlim.rlim_cur = rlim.rlim_max; - (void)setrlimit(RLIMIT_NOFILE, &rlim); - } -#endif - return FALSE; -}
--- a/src/lib/restrict-process-size.h Sat Sep 15 15:58:27 2007 +0300 +++ b/src/lib/restrict-process-size.h Sat Sep 15 16:57:11 2007 +0300 @@ -6,8 +6,5 @@ void restrict_process_size(unsigned int size, unsigned int max_processes); /* Set fd limit to count. */ void restrict_fd_limit(unsigned int count); -/* If fd limit is less than count, try to raise it. Probably fails (silently) - if we're not running as root. Returns TRUE if succeeded. */ -bool restrict_raise_fd_limit(unsigned int count); #endif