Imported Upstream version 1.4.13+git200906171200

This commit is contained in:
Jan Wagner 2013-11-26 23:56:50 +01:00
parent 4ab9f0d24c
commit d0b8ab8112
362 changed files with 34110 additions and 10773 deletions

View file

@ -1,8 +1,8 @@
/* Get the system load averages.
Copyright (C) 1985, 1986, 1987, 1988, 1989, 1991, 1992, 1993, 1994,
1995, 1997, 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software
Foundation, Inc.
1995, 1997, 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free
Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with gnulib.
Bugs can be reported to bug-gnulib@gnu.org.
@ -89,9 +89,11 @@
# include <stdbool.h>
#endif
/* Specification. */
#include <stdlib.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
/* Exclude all the code except the test program at the end
if the system has its own `getloadavg' function. */
@ -407,6 +409,7 @@
# endif /* LOAD_AVE_TYPE */
# if defined HAVE_LIBPERFSTAT
# include <sys/protosw.h>
# include <libperfstat.h>
# include <sys/proc.h>
# ifndef SBITS
@ -618,8 +621,11 @@ getloadavg (double loadavg[], int nelem)
for (elem = 0; elem < nelem; elem++)
{
char *endptr;
double d = c_strtod (ptr, &endptr);
if (ptr == endptr)
double d;
errno = 0;
d = c_strtod (ptr, &endptr);
if (ptr == endptr || (d == 0 && errno != 0))
{
if (elem == 0)
return -1;