getloadavg: don't depend on c-strtod, cloexec, fcntl-safer
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 8 Feb 2011 20:23:29 +0000 (12:23 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 8 Feb 2011 20:28:27 +0000 (12:28 -0800)
commit6a047cd32e392aab4efd1c0dc6d8d56482d65138
tree6a85b92147a36f007cc9d0c20ff230f50e0de4dd
parentd9f5da66f7c95f84b6b28b17cfa4c5248ad2b591
getloadavg: don't depend on c-strtod, cloexec, fcntl-safer

See the thread rooted at
<http://lists.gnu.org/archive/html/bug-gnulib/2011-02/msg00090.html>.
* lib/getloadavg.c: Do not include c-strtod.h, cloexec.h, or fcntl--.h.
Include <fcntl.h> only if (defined __linux__ || defined __CYGWIN__
|| defined SUNOS_5 || (defined LOAD_AVE_TYPE && !  defined
__VMS)); previously it was always included (via fcntl--.h).
(getloadavg): Do not use c_strtod.  Instead, approximate it by
hand; this is good enough for load averages.  Also, do not use
set_cloexec_flag; instead, use the O_CLOEXEC and F_DUPFD_CLOEXEC
flags directly if available and don't bother otherwise.  (Packages
that need the extra reliability should use the modules that define
these flags on older platforms that lack them.)
* modules/getloadavg (Depends-on): Remove c-strtod, cloexec,
fcntl-safer.
ChangeLog
lib/getloadavg.c
modules/getloadavg