summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-04-11 20:02:28 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-04-11 20:02:28 +0000
commit8bd8ca4bf3a6f1761d2d8a76fc7f89608bf474dd (patch)
treee5bf84ab89f9141203130ba3f36ba39ef28b7c83
parent01dbbdf612b53132546517b7e73d82d46e6808b6 (diff)
downloadcoreutils-8bd8ca4bf3a6f1761d2d8a76fc7f89608bf474dd.tar.xz
Include unistd-safer.h.
(getloadavg): Use fd_safer.
-rw-r--r--lib/getloadavg.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/getloadavg.c b/lib/getloadavg.c
index 7732ddd0d..b4b4e7517 100644
--- a/lib/getloadavg.c
+++ b/lib/getloadavg.c
@@ -452,6 +452,8 @@
# else
# include <sys/file.h>
# endif
+
+# include "unistd-safer.h"
/* Avoid static vars inside a function since in HPUX they dump as pure. */
@@ -911,7 +913,7 @@ getloadavg (double loadavg[], int nelem)
if (!getloadavg_initialized)
{
# ifndef SUNOS_5
- channel = open ("/dev/kmem", 0);
+ channel = fd_safer (open ("/dev/kmem", O_RDONLY));
if (channel >= 0)
{
/* Set the channel to close on exec, so it does not