Bug 251408 - rdisc.c does not compile because OPEN_MAX not defined
rdisc.c does not compile because OPEN_MAX not defined
Status: CLOSED DUPLICATE of bug 251124
Product: Fedora
Classification: Fedora
Component: iputils (Show other bugs)
rawhide
All Linux
low Severity low
: ---
: ---
Assigned To: Martin Bacovsky
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-08 15:25 EDT by Sami Farin
Modified: 2007-11-30 17:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-09 04:25:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
use getrlimit instead of OPEN_MAX (719 bytes, patch)
2007-08-08 15:25 EDT, Sami Farin
no flags Details | Diff

  None (edit)
Description Sami Farin 2007-08-08 15:25:35 EDT
Description of problem:
gcc     rdisc.c  -lresolv -o rdisc
rdisc.c: In function 'do_fork':
rdisc.c:250: error: 'OPEN_MAX' undeclared (first use in this function)
rdisc.c:250: error: (Each undeclared identifier is reported only once
rdisc.c:250: error: for each function it appears in.)
make: *** [rdisc] Error 1

(glibc-2.6-4)

Version-Release number of selected component (if applicable):
iputils-20070202-3.fc7

How reproducible:
always

Steps to Reproduce:
1. make
2.
3.
  
Actual results:
rdisc.c compilation fails

Expected results:
successful compilation

Additional info:
patch attached
Comment 1 Sami Farin 2007-08-08 15:25:35 EDT
Created attachment 160929 [details]
use getrlimit instead of OPEN_MAX
Comment 2 Martin Bacovsky 2007-08-08 16:00:40 EDT
Yesterday I built iputils-20070202-4.fc8 in RAWHIDE which fix this problem.
Thanks  for patch. I used open_max = sysconf(_SC_OPEN_MAX). Any idea what is
preffered way  of fixing this issue?
Comment 3 Sami Farin 2007-08-08 16:39:35 EDT
Using sysconf is fine, too, but it returns rlim_cur instead of rlim_max.
But nobody probably cares or notices, anyways, and with sysconf you can get away
with smaller number of code lines.

What if returned value is RLIM_INFINITY?
Then user running rdisc might want to fix his/her ulimit.
Comment 4 Martin Bacovsky 2007-08-09 04:25:50 EDT
Well then I close this as duplicate and keep my patch in iputils. Thanks.

*** This bug has been marked as a duplicate of 251124 ***

Note You need to log in before you can comment on or make changes to this bug.