From 8822d7c9d8e86358cc4bb86e306ff90e40a15401 Mon Sep 17 00:00:00 2001 From: octo Date: Fri, 21 Apr 2006 07:52:42 +0000 Subject: [PATCH] octo@crystal:~/Projects/collectd $ svn merge -r646:651 trunk tags/collectd-3.9.1 --- configure.in | 8 ++++---- src/Makefile.am | 6 +++--- src/collectd.c | 2 +- src/common.c | 2 +- src/hddtemp.c | 3 ++- src/nfs.c | 15 ++++++++------- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/configure.in b/configure.in index f2573a32..aae2a771 100644 --- a/configure.in +++ b/configure.in @@ -174,10 +174,6 @@ AC_CHECK_HEADERS(IOKit/ps/IOPowerSources.h, [], [], ]) AC_CHECK_HEADERS(IOKit/ps/IOPSKeys.h) -# For the `disk' plugin -AC_CHECK_HEADERS(IOKit/IOBSD.h) -AC_CHECK_HEADERS(IOKit/storage/IOBlockStorageDriver.h) - # For load module AC_CHECK_HEADERS(sys/loadavg.h) @@ -270,6 +266,10 @@ AC_CHECK_FUNCS(strchr memcpy strstr strcmp strncmp strncpy strlen) AC_CHECK_FUNCS(strncasecmp strcasecmp) AC_CHECK_FUNCS(openlog syslog closelog) +nanosleep_needs_rt="no" +AC_CHECK_FUNCS(nanosleep, [], AC_CHECK_LIB(rt, nanosleep, [nanosleep_needs_rt="yes"], AC_MSG_ERROR(cannot find nanosleep))) +AM_CONDITIONAL(BUILD_WITH_LIBRT, test "x$nanosleep_needs_rt" = "xyes") + # For cpu module AC_CHECK_FUNCS(sysctlbyname, [have_sysctlbyname="yes"], [have_sysctlbyname="no"]) diff --git a/src/Makefile.am b/src/Makefile.am index 025548a1..1fa0c07c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -32,6 +32,9 @@ collectd_LDFLAGS = -export-dynamic if BUILD_WITH_RRDTOOL collectd_LDFLAGS += -lm -lrrd endif +if BUILD_WITH_LIBRT +collectd_LDFLAGS += -lrt +endif if BUILD_WITH_LIBSOCKET collectd_LDFLAGS += -lsocket endif @@ -105,9 +108,6 @@ if BUILD_MODULE_DISK pkglib_LTLIBRARIES += disk.la disk_la_SOURCES = disk.c disk_la_LDFLAGS = -module -avoid-version -if BUILD_WITH_LIBIOKIT -disk_la_LDFLAGS += -lIOKit -endif collectd_LDADD += "-dlopen" disk.la collectd_DEPENDENCIES += disk.la endif diff --git a/src/collectd.c b/src/collectd.c index 1b44e153..b4ee5046 100644 --- a/src/collectd.c +++ b/src/collectd.c @@ -256,7 +256,7 @@ static int pidfile_create (const char *file) return (1); } - fprintf (fh, "%d\n", getpid()); + fprintf (fh, "%i\n", (int) getpid ()); fclose(fh); return (0); diff --git a/src/common.c b/src/common.c index 58db4d8a..d1f15513 100644 --- a/src/common.c +++ b/src/common.c @@ -488,7 +488,7 @@ static int log_create_file (char *filename, char **ds_def, int ds_num) /* The `%.*s' is needed because there is no null-byte behind * the name. */ - fprintf(log, ",%.*s", (tmp - name), name); + fprintf(log, ",%.*s", (int) (tmp - name), name); } fprintf(log, "\n"); fclose(log); diff --git a/src/hddtemp.c b/src/hddtemp.c index a89765a7..cbe6e80a 100644 --- a/src/hddtemp.c +++ b/src/hddtemp.c @@ -346,7 +346,8 @@ static void hddtemp_init (void) if ((entry = (hddname_t *) malloc (sizeof (hddname_t))) == NULL) { - syslog (LOG_ERR, "hddtemp: malloc (%u) == NULL", sizeof (hddname_t)); + syslog (LOG_ERR, "hddtemp: malloc (%u) == NULL", + (unsigned int) sizeof (hddname_t)); free (name); continue; } diff --git a/src/nfs.c b/src/nfs.c index efb8dc68..d0f33c52 100644 --- a/src/nfs.c +++ b/src/nfs.c @@ -27,7 +27,8 @@ #define MODULE_NAME "nfs" -#if defined(KERNEL_LINUX) || defined(HAVE_LIBKSTAT) +/* #if defined(KERNEL_LINUX) || defined(HAVE_LIBKSTAT) */ +#if KERNEL_LINUX # define NFS_HAVE_READ 1 #else # define NFS_HAVE_READ 0 @@ -133,7 +134,7 @@ static char *nfs3_procedures_ds_def[] = }; static int nfs3_procedures_ds_num = 22; -#ifdef HAVE_LIBKSTAT +#if HAVE_LIBKSTAT && 0 extern kstat_ctl_t *kc; static kstat_t *nfs2_ksp_client; static kstat_t *nfs2_ksp_server; @@ -147,7 +148,7 @@ static kstat_t *nfs4_ksp_server; static void nfs_init (void) { -#ifdef HAVE_LIBKSTAT +#if HAVE_LIBKSTAT && 0 kstat_t *ksp_chain; nfs2_ksp_client = NULL; @@ -258,7 +259,7 @@ static void nfs3_procedures_submit (unsigned long long *val, char *inst) } #endif /* NFS_HAVE_READ */ -#if defined(KERNEL_LINUX) +#if KERNEL_LINUX static void nfs_read_stats_file (FILE *fh, char *inst) { char buffer[BUFSIZE]; @@ -329,7 +330,7 @@ static void nfs_read_stats_file (FILE *fh, char *inst) #endif /* defined(KERNEL_LINUX) */ #undef BUFSIZE -#ifdef HAVE_LIBKSTAT +#if HAVE_LIBKSTAT && 0 static void nfs2_read_kstat (kstat_t *ksp, char *inst) { unsigned long long values[18]; @@ -360,7 +361,7 @@ static void nfs2_read_kstat (kstat_t *ksp, char *inst) #if NFS_HAVE_READ static void nfs_read (void) { -#if defined(KERNEL_LINUX) +#if KERNEL_LINUX FILE *fh; if ((fh = fopen ("/proc/net/rpc/nfs", "r")) != NULL) @@ -377,7 +378,7 @@ static void nfs_read (void) /* #endif defined(KERNEL_LINUX) */ -#elif defined(HAVE_LIBKSTAT) +#elif HAVE_LIBKSTAT && 0 if (nfs2_ksp_client != NULL) nfs2_read_kstat (nfs2_ksp_client, "client"); if (nfs2_ksp_server != NULL) -- 2.30.2