From: Florian Forster Date: Sun, 21 Aug 2011 14:51:36 +0000 (+0200) Subject: Merge branch 'collectd-5.0' X-Git-Tag: collectd-5.1.0~53 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=9b967a770f38099336c3652986d93c8b4d610a36;hp=514a9fe8450efe2091d5671c3f7c67a8745b232e;p=collectd.git Merge branch 'collectd-5.0' Conflicts: configure.in src/owniptc/libiptc.c Change-Id: I0ab8fc1accd476f5d1a243b1a155eac4b751cd8c --- diff --git a/configure.in b/configure.in index f2404664..3b641d16 100644 --- a/configure.in +++ b/configure.in @@ -2,6 +2,7 @@ dnl Process this file with autoconf to produce a configure script. AC_INIT(collectd, m4_esyscmd(./version-gen.sh)) AC_CONFIG_SRCDIR(src/collectd.c) AC_CONFIG_HEADERS(src/config.h) +AC_CONFIG_AUX_DIR([libltdl/config]) m4_ifdef([LT_PACKAGE_VERSION], # libtool >= 2.2 @@ -3820,6 +3821,7 @@ then CPPFLAGS="$CPPFLAGS $with_libyajl_cppflags" AC_CHECK_HEADERS(yajl/yajl_parse.h, [with_libyajl="yes"], [with_libyajl="no (yajl/yajl_parse.h not found)"]) + AC_CHECK_HEADERS(yajl/yajl_version.h) CPPFLAGS="$SAVE_CPPFLAGS" fi diff --git a/contrib/migrate-4-5.px b/contrib/migrate-4-5.px index 1e54683a..539eaa33 100755 --- a/contrib/migrate-4-5.px +++ b/contrib/migrate-4-5.px @@ -32,7 +32,6 @@ use Data::Dumper (); use File::Basename ('dirname'); our $InDir = '/var/lib/collectd'; -our $OutDir = '/tmp/collectd-5'; our $RRDtool = 'rrdtool'; our %TypesCounterToDerive = # {{{ @@ -46,7 +45,6 @@ our %TypesCounterToDerive = # {{{ connections => ["value"], cpu => ["value"], current => ["value"], - df => ["used", "free"], disk_merged => ["read", "write"], disk_octets => ["read", "write"], disk_ops => ["read", "write"], @@ -226,8 +224,6 @@ Valid options are: --indir Source directory Default: $InDir - --outdir Destination directory - Default: $OutDir --rrdtool Path to the RRDtool binary Default: $RRDtool @@ -236,7 +232,6 @@ EOF } # }}} sub exit_usage GetOptions ("indir|i=s" => \$InDir, - "outdir|o=s" => \$OutDir, "rrdtool=s" => \$RRDtool, "help|h" => \&exit_usage) or exit_usage (); diff --git a/src/apache.c b/src/apache.c index 9be32d16..c31dd875 100644 --- a/src/apache.c +++ b/src/apache.c @@ -373,6 +373,7 @@ static int init_host (apache_t *st) /* {{{ */ return (-1); } + curl_easy_setopt (st->curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt (st->curl, CURLOPT_WRITEFUNCTION, apache_curl_callback); curl_easy_setopt (st->curl, CURLOPT_WRITEDATA, st); diff --git a/src/ascent.c b/src/ascent.c index 6782fce1..993e480c 100644 --- a/src/ascent.c +++ b/src/ascent.c @@ -539,6 +539,7 @@ static int ascent_init (void) /* {{{ */ return (-1); } + curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, ascent_curl_callback); curl_easy_setopt (curl, CURLOPT_USERAGENT, PACKAGE_NAME"/"PACKAGE_VERSION); curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, ascent_curl_error); diff --git a/src/bind.c b/src/bind.c index db8a891f..b640a596 100644 --- a/src/bind.c +++ b/src/bind.c @@ -1385,6 +1385,7 @@ static int bind_init (void) /* {{{ */ return (-1); } + curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, bind_curl_callback); curl_easy_setopt (curl, CURLOPT_USERAGENT, PACKAGE_NAME"/"PACKAGE_VERSION); curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, bind_curl_error); diff --git a/src/collectd.h b/src/collectd.h index 8dd0f426..4079ad1f 100644 --- a/src/collectd.h +++ b/src/collectd.h @@ -97,6 +97,12 @@ # define assert(...) /* nop */ #endif +#if !defined(HAVE__BOOL) || !HAVE__BOOL +typedef int _Bool; +# undef HAVE__BOOL +# define HAVE__BOOL 1 +#endif + #if NAN_STATIC_DEFAULT # include /* #endif NAN_STATIC_DEFAULT*/ diff --git a/src/csv.c b/src/csv.c index 87a7b4e3..02d62c1e 100644 --- a/src/csv.c +++ b/src/csv.c @@ -264,7 +264,7 @@ static int csv_write (const data_set_t *ds, const value_list_t *vl, { struct stat statbuf; char filename[512]; - char values[512]; + char values[4096]; FILE *csv; int csv_fd; struct flock fl; diff --git a/src/curl.c b/src/curl.c index 8b95c80f..2160b980 100644 --- a/src/curl.c +++ b/src/curl.c @@ -370,6 +370,7 @@ static int cc_page_init_curl (web_page_t *wp) /* {{{ */ return (-1); } + curl_easy_setopt (wp->curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt (wp->curl, CURLOPT_WRITEFUNCTION, cc_curl_callback); curl_easy_setopt (wp->curl, CURLOPT_WRITEDATA, wp); curl_easy_setopt (wp->curl, CURLOPT_USERAGENT, diff --git a/src/curl_json.c b/src/curl_json.c index 5549f0ab..988ed58d 100644 --- a/src/curl_json.c +++ b/src/curl_json.c @@ -1,7 +1,7 @@ /** * collectd - src/curl_json.c * Copyright (C) 2009 Doug MacEachern - * Copyright (C) 2006-2010 Florian octo Forster + * Copyright (C) 2006-2011 Florian octo Forster * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -18,7 +18,7 @@ * * Authors: * Doug MacEachern - * Florian octo Forster + * Florian octo Forster **/ #include "collectd.h" @@ -29,6 +29,13 @@ #include #include +#if HAVE_YAJL_YAJL_VERSION_H +# include +#endif + +#if defined(YAJL_MAJOR) && (YAJL_MAJOR > 1) +# define HAVE_YAJL_V2 1 +#endif #define CJ_DEFAULT_HOST "localhost" #define CJ_KEY_MAGIC 0x43484b59UL /* CHKY */ @@ -77,6 +84,12 @@ struct cj_s /* {{{ */ }; typedef struct cj_s cj_t; /* }}} */ +#if HAVE_YAJL_V2 +typedef size_t yajl_len_t; +#else +typedef unsigned int yajl_len_t; +#endif + static int cj_read (user_data_t *ud); static int cj_curl_perform (cj_t *db, CURL *curl); static void cj_submit (cj_t *db, cj_key_t *key, value_t *value); @@ -97,9 +110,22 @@ static size_t cj_curl_callback (void *buf, /* {{{ */ if (db == NULL) return (0); - status = yajl_parse(db->yajl, (unsigned char *)buf, len); - if ((status != yajl_status_ok) - && (status != yajl_status_insufficient_data)) + status = yajl_parse(db->yajl, (unsigned char *) buf, len); + if (status == yajl_status_ok) + { +#if HAVE_YAJL_V2 + status = yajl_complete_parse(db->yajl); +#else + status = yajl_parse_complete(db->yajl); +#endif + return (len); + } +#if !HAVE_YAJL_V2 + else if (status == yajl_status_insufficient_data) + return (len); +#endif + + if (status != yajl_status_ok) { unsigned char *msg = yajl_get_error(db->yajl, /* verbose = */ 1, @@ -130,7 +156,7 @@ static int cj_get_type (cj_key_t *key) /* "number" may not be null terminated, so copy it into a buffer before * parsing. */ static int cj_cb_number (void *ctx, - const char *number, unsigned int number_len) + const char *number, yajl_len_t number_len) { char buffer[number_len + 1]; @@ -159,7 +185,7 @@ static int cj_cb_number (void *ctx, } /* int cj_cb_number */ static int cj_cb_map_key (void *ctx, const unsigned char *val, - unsigned int len) + yajl_len_t len) { cj_t *db = (cj_t *)ctx; c_avl_tree_t *tree; @@ -187,7 +213,7 @@ static int cj_cb_map_key (void *ctx, const unsigned char *val, } static int cj_cb_string (void *ctx, const unsigned char *val, - unsigned int len) + yajl_len_t len) { cj_t *db = (cj_t *)ctx; char str[len + 1]; @@ -472,6 +498,7 @@ static int cj_init_curl (cj_t *db) /* {{{ */ return (-1); } + curl_easy_setopt (db->curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt (db->curl, CURLOPT_WRITEFUNCTION, cj_curl_callback); curl_easy_setopt (db->curl, CURLOPT_WRITEDATA, db); curl_easy_setopt (db->curl, CURLOPT_USERAGENT, @@ -697,7 +724,13 @@ static int cj_curl_perform (cj_t *db, CURL *curl) /* {{{ */ char *url; yajl_handle yprev = db->yajl; - db->yajl = yajl_alloc (&ycallbacks, NULL, NULL, (void *)db); + db->yajl = yajl_alloc (&ycallbacks, +#if HAVE_YAJL_V2 + /* alloc funcs = */ NULL, +#else + /* alloc funcs = */ NULL, NULL, +#endif + /* context = */ (void *)db); if (db->yajl == NULL) { ERROR ("curl_json plugin: yajl_alloc failed."); diff --git a/src/curl_xml.c b/src/curl_xml.c index c10955cb..61b5aded 100644 --- a/src/curl_xml.c +++ b/src/curl_xml.c @@ -734,6 +734,7 @@ static int cx_init_curl (cx_t *db) /* {{{ */ return (-1); } + curl_easy_setopt (db->curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt (db->curl, CURLOPT_WRITEFUNCTION, cx_curl_callback); curl_easy_setopt (db->curl, CURLOPT_WRITEDATA, db); curl_easy_setopt (db->curl, CURLOPT_USERAGENT, diff --git a/src/df.c b/src/df.c index 4b3cba01..5391f50c 100644 --- a/src/df.c +++ b/src/df.c @@ -33,12 +33,14 @@ # include # endif # define STATANYFS statvfs +# define STATANYFS_STR "statvfs" # define BLOCKSIZE(s) ((s).f_frsize ? (s).f_frsize : (s).f_bsize) #elif HAVE_STATFS # if HAVE_SYS_STATFS_H # include # endif # define STATANYFS statfs +# define STATANYFS_STR "statfs" # define BLOCKSIZE(s) (s).f_bsize #else # error "No applicable input method." @@ -198,7 +200,8 @@ static int df_read (void) if (STATANYFS (mnt_ptr->dir, &statbuf) < 0) { char errbuf[1024]; - ERROR ("statv?fs failed: %s", + ERROR (STATANYFS_STR"(%s) failed: %s", + mnt_ptr->dir, sstrerror (errno, errbuf, sizeof (errbuf))); continue; diff --git a/src/disk.c b/src/disk.c index 697d850f..fde0dcde 100644 --- a/src/disk.c +++ b/src/disk.c @@ -426,7 +426,6 @@ static int disk_read (void) int numfields; int fieldshift = 0; - int major = 0; int minor = 0; derive_t read_sectors = 0; @@ -464,7 +463,6 @@ static int disk_read (void) if ((numfields != (14 + fieldshift)) && (numfields != 7)) continue; - major = atoll (fields[0]); minor = atoll (fields[1]); disk_name = fields[2 + fieldshift]; diff --git a/src/java.c b/src/java.c index af0861f6..b69ca946 100644 --- a/src/java.c +++ b/src/java.c @@ -2256,7 +2256,6 @@ static int cjni_config_plugin_block (oconfig_item_t *ci) /* {{{ */ cjni_callback_info_t *cbi; jobject o_ocitem; const char *name; - int status; size_t i; jclass class; @@ -2311,7 +2310,7 @@ static int cjni_config_plugin_block (oconfig_item_t *ci) /* {{{ */ method = (*jvm_env)->GetMethodID (jvm_env, class, "config", "(Lorg/collectd/api/OConfigItem;)I"); - status = (*jvm_env)->CallIntMethod (jvm_env, + (*jvm_env)->CallIntMethod (jvm_env, cbi->object, method, o_ocitem); (*jvm_env)->DeleteLocalRef (jvm_env, o_ocitem); @@ -3080,9 +3079,8 @@ static int cjni_init (void) /* {{{ */ if (config_block != NULL) { - int status; - status = cjni_config_perform (config_block); + cjni_config_perform (config_block); oconfig_free (config_block); config_block = NULL; } diff --git a/src/libvirt.c b/src/libvirt.c index c74b937e..774067cd 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -138,16 +138,12 @@ init_value_list (value_list_t *vl, virDomainPtr dom) int i, n; const char *name; char uuid[VIR_UUID_STRING_BUFLEN]; - char *host_ptr; - size_t host_len; vl->interval = interval_g; sstrncpy (vl->plugin, "libvirt", sizeof (vl->plugin)); vl->host[0] = '\0'; - host_ptr = vl->host; - host_len = sizeof (vl->host); /* Construct the hostname field according to HostnameFormat. */ for (i = 0; i < HF_MAX_FIELDS; ++i) { diff --git a/src/match_empty_counter.c b/src/match_empty_counter.c index b9afd817..1ab445a7 100644 --- a/src/match_empty_counter.c +++ b/src/match_empty_counter.c @@ -73,7 +73,6 @@ static int mec_match (const data_set_t __attribute__((unused)) *ds, /* {{{ */ const value_list_t *vl, notification_meta_t __attribute__((unused)) **meta, void **user_data) { - mec_match_t *m; int num_counters; int num_empty; int i; @@ -81,7 +80,6 @@ static int mec_match (const data_set_t __attribute__((unused)) *ds, /* {{{ */ if ((user_data == NULL) || (*user_data == NULL)) return (-1); - m = *user_data; num_counters = 0; num_empty = 0; diff --git a/src/meta_data.c b/src/meta_data.c index 6a336c4b..aff3f8e5 100644 --- a/src/meta_data.c +++ b/src/meta_data.c @@ -215,6 +215,7 @@ void meta_data_destroy (meta_data_t *md) /* {{{ */ return; md_entry_free (md->head); + pthread_mutex_destroy (&md->lock); free (md); } /* }}} void meta_data_destroy */ diff --git a/src/mysql.c b/src/mysql.c index cae6760b..6b636787 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -555,7 +555,6 @@ static int mysql_read (user_data_t *ud) MYSQL_RES *res; MYSQL_ROW row; char *query; - int field_num; derive_t qcache_hits = 0; derive_t qcache_inserts = 0; @@ -591,7 +590,6 @@ static int mysql_read (user_data_t *ud) if (res == NULL) return (-1); - field_num = mysql_num_fields (res); while ((row = mysql_fetch_row (res))) { char *key; diff --git a/src/network.c b/src/network.c index cc3d6b3a..38534264 100644 --- a/src/network.c +++ b/src/network.c @@ -788,7 +788,6 @@ static int parse_part_number (void **ret_buffer, size_t *ret_buffer_len, size_t exp_size = 2 * sizeof (uint16_t) + sizeof (uint64_t); uint16_t pkg_length; - uint16_t pkg_type; if ((buffer_len < 0) || ((size_t) buffer_len < exp_size)) { @@ -802,7 +801,7 @@ static int parse_part_number (void **ret_buffer, size_t *ret_buffer_len, memcpy ((void *) &tmp16, buffer, sizeof (tmp16)); buffer += sizeof (tmp16); - pkg_type = ntohs (tmp16); + /* pkg_type = ntohs (tmp16); */ memcpy ((void *) &tmp16, buffer, sizeof (tmp16)); buffer += sizeof (tmp16); @@ -828,7 +827,6 @@ static int parse_part_string (void **ret_buffer, size_t *ret_buffer_len, size_t header_size = 2 * sizeof (uint16_t); uint16_t pkg_length; - uint16_t pkg_type; if ((buffer_len < 0) || (buffer_len < header_size)) { @@ -842,7 +840,7 @@ static int parse_part_string (void **ret_buffer, size_t *ret_buffer_len, memcpy ((void *) &tmp16, buffer, sizeof (tmp16)); buffer += sizeof (tmp16); - pkg_type = ntohs (tmp16); + /* pkg_type = ntohs (tmp16); */ memcpy ((void *) &tmp16, buffer, sizeof (tmp16)); buffer += sizeof (tmp16); diff --git a/src/nginx.c b/src/nginx.c index 1cb7a90a..3e162bac 100644 --- a/src/nginx.c +++ b/src/nginx.c @@ -120,6 +120,7 @@ static int init (void) return (-1); } + curl_easy_setopt (curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, nginx_curl_callback); curl_easy_setopt (curl, CURLOPT_USERAGENT, PACKAGE_NAME"/"PACKAGE_VERSION); curl_easy_setopt (curl, CURLOPT_ERRORBUFFER, nginx_curl_error); diff --git a/src/notify_desktop.c b/src/notify_desktop.c index 839bc610..3f3c6dfc 100644 --- a/src/notify_desktop.c +++ b/src/notify_desktop.c @@ -31,6 +31,10 @@ #include #include +#ifndef NOTIFY_CHECK_VERSION +# define NOTIFY_CHECK_VERSION(x,y,z) 0 +#endif + #define log_info(...) INFO ("notify_desktop: " __VA_ARGS__) #define log_warn(...) WARNING ("notify_desktop: " __VA_ARGS__) #define log_err(...) ERROR ("notify_desktop: " __VA_ARGS__) @@ -95,7 +99,12 @@ static int c_notify (const notification_t *n, : (NOTIF_WARNING == n->severity) ? "WARNING" : (NOTIF_OKAY == n->severity) ? "OKAY" : "UNKNOWN"); - notification = notify_notification_new (summary, n->message, NULL, NULL); + notification = notify_notification_new (summary, n->message, NULL +#if NOTIFY_CHECK_VERSION (0, 7, 0) + ); +#else + , NULL); +#endif if (NULL == notification) { log_err ("Failed to create a new notification."); return -1; diff --git a/src/notify_email.c b/src/notify_email.c index da6894a3..cd216ca2 100644 --- a/src/notify_email.c +++ b/src/notify_email.c @@ -228,7 +228,6 @@ static int notify_email_config (const char *key, const char *value) static int notify_email_notification (const notification_t *n, user_data_t __attribute__((unused)) *user_data) { - smtp_recipient_t recipient; time_t tt; struct tm timestamp_tm; @@ -290,7 +289,7 @@ static int notify_email_notification (const notification_t *n, smtp_set_message_str (message, buf); for (i = 0; i < recipients_len; i++) - recipient = smtp_add_recipient (message, recipients[i]); + smtp_add_recipient (message, recipients[i]); /* Initiate a connection to the SMTP server and transfer the message. */ if (!smtp_start_session (session)) { @@ -300,11 +299,13 @@ static int notify_email_notification (const notification_t *n, pthread_mutex_unlock (&session_lock); return (-1); } else { + #if COLLECT_DEBUG const smtp_status_t *status; /* Report on the success or otherwise of the mail transfer. */ status = smtp_message_transfer_status (message); DEBUG ("notify_email plugin: SMTP server report: %d %s", - status->code, (status->text != NULL) ? status->text : "\n"); + status->code, (status->text != NULL) ? status->text : "\n"); + #endif smtp_enumerate_recipients (message, print_recipient_status, NULL); } diff --git a/src/processes.c b/src/processes.c index 72442f09..0c24cb70 100644 --- a/src/processes.c +++ b/src/processes.c @@ -871,7 +871,6 @@ int ps_read_process (int pid, procstat_t *ps, char *state) int i; - int ppid; int name_len; derive_t cpu_user_counter; @@ -909,7 +908,6 @@ int ps_read_process (int pid, procstat_t *ps, char *state) fields[1][name_len] = '\0'; strncpy (ps->name, fields[1], PROCSTAT_NAME_LEN); - ppid = atoi (fields[3]); *state = fields[2][0]; diff --git a/src/rrdtool.c b/src/rrdtool.c index b366a9c6..56a82d03 100644 --- a/src/rrdtool.c +++ b/src/rrdtool.c @@ -998,7 +998,7 @@ static int rrd_config (const char *key, const char *value) } else if (strcasecmp ("StepSize", key) == 0) { - int temp = atoi (value); + unsigned long temp = strtoul (value, NULL, 0); if (temp > 0) rrdcreate_config.stepsize = temp; } @@ -1161,8 +1161,6 @@ static int rrd_init (void) return (0); init_once = 1; - if (rrdcreate_config.stepsize < 0) - rrdcreate_config.stepsize = 0; if (rrdcreate_config.heartbeat <= 0) rrdcreate_config.heartbeat = 2 * rrdcreate_config.stepsize; @@ -1206,7 +1204,7 @@ static int rrd_init (void) } queue_thread_running = 1; - DEBUG ("rrdtool plugin: rrd_init: datadir = %s; stepsize = %i;" + DEBUG ("rrdtool plugin: rrd_init: datadir = %s; stepsize = %lu;" " heartbeat = %i; rrarows = %i; xff = %lf;", (datadir == NULL) ? "(null)" : datadir, rrdcreate_config.stepsize, diff --git a/src/teamspeak2.c b/src/teamspeak2.c index a78e700f..2552ad30 100644 --- a/src/teamspeak2.c +++ b/src/teamspeak2.c @@ -299,6 +299,13 @@ static int tss2_get_socket (FILE **ret_read_fh, FILE **ret_write_fh) char *buffer_ptr; buffer_ptr = fgets (buffer, sizeof (buffer), global_read_fh); + if (buffer_ptr == NULL) + { + WARNING ("teamspeak2 plugin: Unexpected EOF received " + "from remote host %s:%s.", + config_host ? config_host : DEFAULT_HOST, + config_port ? config_port : DEFAULT_PORT); + } buffer[sizeof (buffer) - 1] = 0; if (memcmp ("[TS]\r\n", buffer, 6) != 0) diff --git a/src/utils_dns.c b/src/utils_dns.c index d1c8d5d5..cfa4a5cb 100644 --- a/src/utils_dns.c +++ b/src/utils_dns.c @@ -450,7 +450,6 @@ handle_ipv6 (struct ip6_hdr *ipv6, int len) int nexthdr; struct in6_addr s_addr; - struct in6_addr d_addr; uint16_t payload_len; if (0 > len) @@ -459,7 +458,6 @@ handle_ipv6 (struct ip6_hdr *ipv6, int len) offset = sizeof (struct ip6_hdr); nexthdr = ipv6->ip6_nxt; s_addr = ipv6->ip6_src; - d_addr = ipv6->ip6_dst; payload_len = ntohs (ipv6->ip6_plen); if (ignore_list_match (&s_addr)) diff --git a/src/utils_format_json.c b/src/utils_format_json.c index 65c886b6..2a5526b2 100644 --- a/src/utils_format_json.c +++ b/src/utils_format_json.c @@ -264,7 +264,7 @@ static int value_list_to_json (char *buffer, size_t buffer_size, /* {{{ */ return (status); BUFFER_ADD (",\"dsnames\":%s", temp); - BUFFER_ADD (",\"time\":%lu", (unsigned long) vl->time); + BUFFER_ADD (",\"time\":%.3f", CDTIME_T_TO_DOUBLE (vl->time)); BUFFER_ADD (",\"interval\":%.3f", CDTIME_T_TO_DOUBLE (vl->interval)); #define BUFFER_ADD_KEYVAL(key, value) do { \ diff --git a/src/utils_rrdcreate.c b/src/utils_rrdcreate.c index 5b132388..d9cbad73 100644 --- a/src/utils_rrdcreate.c +++ b/src/utils_rrdcreate.c @@ -374,7 +374,7 @@ int cu_rrd_create_file (const char *filename, /* {{{ */ int ds_num; int status = 0; time_t last_up; - int stepsize; + unsigned long stepsize; if (check_create_dir (filename)) return (-1); @@ -413,11 +413,9 @@ int cu_rrd_create_file (const char *filename, /* {{{ */ if (cfg->stepsize > 0) stepsize = cfg->stepsize; else - stepsize = (int) CDTIME_T_TO_TIME_T (vl->interval); + stepsize = (unsigned long) CDTIME_T_TO_TIME_T (vl->interval); - status = srrd_create (filename, - (cfg->stepsize > 0) ? cfg->stepsize : CDTIME_T_TO_TIME_T (vl->interval), - last_up, + status = srrd_create (filename, stepsize, last_up, argc, (const char **) argv); free (argv); diff --git a/src/utils_rrdcreate.h b/src/utils_rrdcreate.h index 935e4e07..103ca570 100644 --- a/src/utils_rrdcreate.h +++ b/src/utils_rrdcreate.h @@ -28,7 +28,7 @@ struct rrdcreate_config_s { - int stepsize; + unsigned long stepsize; int heartbeat; int rrarows; double xff; diff --git a/src/write_http.c b/src/write_http.c index 1a0e4ef0..3035e43a 100644 --- a/src/write_http.c +++ b/src/write_http.c @@ -111,6 +111,7 @@ static int wh_callback_init (wh_callback_t *cb) /* {{{ */ return (-1); } + curl_easy_setopt (cb->curl, CURLOPT_NOSIGNAL, 1); curl_easy_setopt (cb->curl, CURLOPT_USERAGENT, PACKAGE_NAME"/"PACKAGE_VERSION); headers = NULL;