Fix filestuff.c build error if RLIMIT_NOFILE not defined.

Not all systems supporting getrlimit also support RLIMIT_NOFILE
(Eg. All LynxOS systems appear to be lacking support for this).
So check its existance before using it.

gdb/ChangeLog:

        * common/filestuff.c (fdwalk): Add "defined(RLIMIT_NOFILE)"
        preprocessor check.
This commit is contained in:
Joel Brobecker 2013-11-16 22:50:09 -05:00
parent 2dd4d4224a
commit f9b0da3d58
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2013-12-02 Joel Brobecker <brobecker@adacore.com>
* common/filestuff.c (fdwalk): Add "defined(RLIMIT_NOFILE)"
preprocessor check.
2013-12-02 Joel Brobecker <brobecker@adacore.com>
* Makefile.in (HFILES_NO_SRCDIR): Remove "common/gdb_dirent.h".

View File

@ -115,7 +115,7 @@ fdwalk (int (*func) (void *, int), void *arg)
{
int max, fd;
#ifdef HAVE_GETRLIMIT
#if defined(HAVE_GETRLIMIT) && defined(RLIMIT_NOFILE)
struct rlimit rlim;
if (getrlimit (RLIMIT_NOFILE, &rlim) == 0 && rlim.rlim_max != RLIM_INFINITY)