Fixed problems on systems using newer GLIB and GCC (2.96) which no
longer allow the -Wp,-lang-c-c++-comments directive. Also cleaned up getloadavg support that had problems on Solaris and RedHat 7.1. Removed unused variables in a number of functions as a result of warnings when compiled with --enable-debug config option.
This commit is contained in:
@@ -4,9 +4,22 @@
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/utsname.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "../../shared/sockets.h"
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
#if TIME_WITH_SYS_TIME
|
||||
# include <sys/time.h>
|
||||
# include <time.h>
|
||||
#else
|
||||
# if HAVE_SYS_TIME_H
|
||||
# include <sys/time.h>
|
||||
# else
|
||||
# include <time.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include "shared/sockets.h"
|
||||
|
||||
#include "main.h"
|
||||
#include "mode.h"
|
||||
|
||||
+17
-8
@@ -4,16 +4,26 @@
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "../../shared/sockets.h"
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#if defined( HAVE_GETLOADAVG ) && defined( HAVE_SYS_LOADAVG_H )
|
||||
# define USE_GETLOADAVG
|
||||
#else
|
||||
# undef USE_GETLOADAVG
|
||||
#endif
|
||||
|
||||
#include "shared/sockets.h"
|
||||
#include "main.h"
|
||||
#include "mode.h"
|
||||
#include "load.h"
|
||||
|
||||
#ifdef HAVE_GETLOADAVG
|
||||
#include <sys/loadavg.h>
|
||||
#ifdef USE_GETLOADAVG
|
||||
# include <sys/loadavg.h>
|
||||
#endif
|
||||
|
||||
|
||||
int loadavg_fd = 0;
|
||||
|
||||
static double get_loadavg (void);
|
||||
@@ -22,11 +32,11 @@ static double
|
||||
get_loadavg (void)
|
||||
{
|
||||
double load;
|
||||
#ifdef HAVE_GETLOADAVG
|
||||
#ifdef USE_GETLOADAVG
|
||||
double loadavg[LOADAVG_NSTATS];
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_GETLOADAVG
|
||||
#ifndef USE_GETLOADAVG
|
||||
reread (loadavg_fd, "get_load:");
|
||||
sscanf (buffer, "%lf", &load);
|
||||
#else
|
||||
@@ -39,7 +49,7 @@ get_loadavg (void)
|
||||
int
|
||||
load_init ()
|
||||
{
|
||||
#ifndef SOLARIS
|
||||
#ifndef USE_GETLOADAVG
|
||||
if (!loadavg_fd)
|
||||
loadavg_fd = open ("/proc/loadavg", O_RDONLY);
|
||||
#endif
|
||||
@@ -49,12 +59,11 @@ load_init ()
|
||||
int
|
||||
load_close ()
|
||||
{
|
||||
#ifndef SOLARIS
|
||||
#ifndef USE_GETLOADAVG
|
||||
if (loadavg_fd)
|
||||
close (loadavg_fd);
|
||||
|
||||
loadavg_fd = 0;
|
||||
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/time.h>
|
||||
#include <termios.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
@@ -15,8 +14,8 @@
|
||||
|
||||
#include "main.h"
|
||||
#include "mode.h"
|
||||
#include "../../shared/sockets.h"
|
||||
#include "../../shared/debug.h"
|
||||
#include "shared/sockets.h"
|
||||
#include "shared/debug.h"
|
||||
|
||||
// TODO: Commenting... Everything!
|
||||
|
||||
|
||||
@@ -34,8 +34,6 @@ static void get_mem_info (struct meminfo *result);
|
||||
static void
|
||||
get_mem_info (struct meminfo *result)
|
||||
{
|
||||
// int i, res; char *bufptr;
|
||||
int pagesize,page;
|
||||
|
||||
#ifndef SOLARIS
|
||||
reread (meminfo_fd, "get_meminfo:");
|
||||
|
||||
+10
-11
@@ -6,17 +6,20 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef IRIX
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/utsname.h>
|
||||
|
||||
#include "../../shared/sockets.h"
|
||||
#include <string.h>
|
||||
#if defined( IRIX ) || defined( SOLARIS )
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "shared/sockets.h"
|
||||
|
||||
#include "mode.h"
|
||||
#include "main.h"
|
||||
@@ -29,10 +32,6 @@
|
||||
#include "load.h"
|
||||
#include "mem.h"
|
||||
|
||||
#ifdef SOLARIS
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
int ELLIPSIS = '-';
|
||||
|
||||
// TODO: Clean this up... Support multiple display sizes..
|
||||
|
||||
Reference in New Issue
Block a user