Include unistd-safer.h.

(getloadavg): Use fd_safer.
This commit is contained in:
Paul Eggert
2005-04-11 20:02:28 +00:00
parent 01dbbdf612
commit 8bd8ca4bf3
+3 -1
View File
@@ -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