Permalink
Browse files

Added Windows support through Cygwin

  • Loading branch information...
1 parent 6c2dd2d commit d4922c8ddd169b8c127f2fafd22d0820219117bd massie committed Nov 19, 2004
Showing with 3 additions and 10 deletions.
  1. +1 −0 monitor-core/configure.in
  2. +2 −10 monitor-core/srclib/libmetrics/cygwin/metrics.c
View
1 monitor-core/configure.in
@@ -163,6 +163,7 @@ dnl if test "$ac_cv_lib_pthreads_pthread_create" = yes ; then
dnl CFLAGS="$CFLAGS -D_REENTRANT"
dnl fi
dnl fi
+AC_CHECK_LIB(rpc, xdr_string)
if test "$gmetad" = yes ; then
AC_CHECK_LIB(rrd, rrd_create, [echo "The ganglia graphs are created using RRDTool (http://www.rrdtool.com/)"], [echo "rrd lib not found"], [-lm])
View
12 monitor-core/srclib/libmetrics/cygwin/metrics.c
@@ -1,5 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <time.h>
#include <unistd.h>
#include <ctype.h>
@@ -96,16 +97,7 @@ metric_init(void)
return rval;
}
- rval.int32 = slurpfile( "/proc/sys/kernel/osrelease",
- proc_sys_kernel_osrelease, BUFFSIZE);
- if ( rval.int32 == SYNAPSE_FAILURE )
- {
- err_msg("kernel_func() got an error from slurpfile()");
- return rval;
- }
-
- /* Get rid of pesky \n in osrelease */
- proc_sys_kernel_osrelease[rval.int32-1] = '\0';
+ strcpy( proc_sys_kernel_osrelease, "cygwin" );
rval.int32 = (int) update_file(&proc_net_dev);
if ( rval.int32 == SYNAPSE_FAILURE )

0 comments on commit d4922c8

Please sign in to comment.