From: Joel Brobecker Date: Sun, 17 Nov 2013 03:50:09 +0000 (-0500) Subject: Fix filestuff.c build error if RLIMIT_NOFILE not defined. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f9b0da3d5833ad5f809422f3084b0ef8fa5c5762;p=binutils-gdb.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a328d061066..62abbaca43f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-12-02 Joel Brobecker + + * common/filestuff.c (fdwalk): Add "defined(RLIMIT_NOFILE)" + preprocessor check. + 2013-12-02 Joel Brobecker * Makefile.in (HFILES_NO_SRCDIR): Remove "common/gdb_dirent.h". diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c index 2792d59fd8b..b884c02d1c5 100644 --- a/gdb/common/filestuff.c +++ b/gdb/common/filestuff.c @@ -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)