diff options
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/storage/file/fd.c | 4 | ||||
-rw-r--r-- | src/backend/tcop/postgres.c | 8 |
2 files changed, 2 insertions, 10 deletions
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index f904f60c086..447d5a86c30 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -895,11 +895,7 @@ count_usable_fds(int max_to_probe, int *usable_fds, int *already_open) fd = (int *) palloc(size * sizeof(int)); #ifdef HAVE_GETRLIMIT -#ifdef RLIMIT_NOFILE /* most platforms use RLIMIT_NOFILE */ getrlimit_status = getrlimit(RLIMIT_NOFILE, &rlim); -#else /* but BSD doesn't ... */ - getrlimit_status = getrlimit(RLIMIT_OFILE, &rlim); -#endif /* RLIMIT_NOFILE */ if (getrlimit_status != 0) ereport(WARNING, (errmsg("getrlimit failed: %m"))); #endif /* HAVE_GETRLIMIT */ diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index 078fbdb5a0c..11e802eba98 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -4770,7 +4770,7 @@ forbidden_in_wal_sender(char firstchar) long get_stack_depth_rlimit(void) { -#if defined(HAVE_GETRLIMIT) && defined(RLIMIT_STACK) +#if defined(HAVE_GETRLIMIT) static long val = 0; /* This won't change after process launch, so check just once */ @@ -4789,13 +4789,9 @@ get_stack_depth_rlimit(void) val = rlim.rlim_cur; } return val; -#else /* no getrlimit */ -#if defined(WIN32) || defined(__CYGWIN__) +#else /* On Windows we set the backend stack size in src/backend/Makefile */ return WIN32_STACK_RLIMIT; -#else /* not windows ... give up */ - return -1; -#endif #endif } |