diff options
author | marha <marha@users.sourceforge.net> | 2009-11-06 15:42:44 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-11-06 15:42:44 +0000 |
commit | fa6c428cc762a412544f98f3514dd05158b1cf9b (patch) | |
tree | eacb5c5ee0a6e7cf699600bc626a20c6bc12f9a1 /apps/xload/get_rload.c | |
parent | af107bc67aab2009b8799126bab32a386dcc8ee1 (diff) | |
download | vcxsrv-fa6c428cc762a412544f98f3514dd05158b1cf9b.tar.gz vcxsrv-fa6c428cc762a412544f98f3514dd05158b1cf9b.tar.bz2 vcxsrv-fa6c428cc762a412544f98f3514dd05158b1cf9b.zip |
Reverted revison 267
Diffstat (limited to 'apps/xload/get_rload.c')
-rw-r--r-- | apps/xload/get_rload.c | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/apps/xload/get_rload.c b/apps/xload/get_rload.c deleted file mode 100644 index 9629d01f9..000000000 --- a/apps/xload/get_rload.c +++ /dev/null @@ -1,76 +0,0 @@ -/* $XFree86: xc/programs/xload/get_rload.c,v 1.4 2002/01/07 20:38:31 dawes Exp $ */ - -#include <stdio.h> -#include <X11/Intrinsic.h> -#include <fcntl.h> -#include <stdlib.h> -#include <unistd.h> -#include "xload.h" - -/* Not all OS supports get_rload - steal the STUB idea from get_load - */ -#if defined(QNX4) || defined(__CYGWIN__) -#define RLOADSTUB -#endif - -#ifdef RLOADSTUB -void GetRLoadPoint( w, closure, call_data ) - Widget w; /* unused */ - XtPointer closure; /* unused */ - XtPointer call_data; /* pointer to (double) return value */ - -{ - *(double *)call_data = 1.0; -} -#else /* RLOADSTUB */ - -#include <protocols/rwhod.h> -#ifndef _PATH_RWHODIR -#define _PATH_RWHODIR "/var/spool/rwho" -#endif - -typedef struct _XLoadResources { - Boolean show_label; - Boolean use_lights; - String remote; -} XLoadResources; - -extern XLoadResources resources ; - -#define WHDRSIZE ((int)(sizeof (buf) - sizeof (buf.wd_we))) - -void GetRLoadPoint( w, closure, call_data ) - Widget w; /* unused */ - XtPointer closure; /* unused */ - XtPointer call_data; /* pointer to (double) return value */ - -{ - int f; - static char *fname = NULL; - static struct whod buf; - int cc; - - *(double *)call_data = 0.0; /* to be on the safe side */ - - if (fname == NULL) { - if ((fname = malloc(strlen(_PATH_RWHODIR)+strlen("/whod.")+strlen(resources.remote)+1)) == NULL) { - fprintf(stderr,"GetRLoadPoint: malloc() failed\n"); - exit(1); - } - strcpy(fname,_PATH_RWHODIR); - strcat(fname,"/whod."); - strcat(fname,resources.remote); - } - if ((f = open(fname, O_RDONLY, 0)) < 0) - return; - - cc = read(f, &buf, sizeof(buf)); - close(f); - if (cc < WHDRSIZE) - return; - - *(double *)call_data = buf.wd_loadav[0] / 100.0; -} - -#endif /* RLOADSTUB */ |