configure: Fixed linker options when checking for amqp_tcp_socket_new.
[collectd.git] / src / rrdcached.c
index a8305e6..e77be2d 100644 (file)
@@ -46,7 +46,9 @@ static rrdcreate_config_t rrdcreate_config =
        /* timespans_num = */ 0,
 
        /* consolidation_functions = */ NULL,
-       /* consolidation_functions_num = */ 0
+       /* consolidation_functions_num = */ 0,
+
+       /* async = */ 0
 };
 
 /*
@@ -121,12 +123,15 @@ static int value_list_to_filename (char *buffer, size_t buffer_size,
 
   if (datadir != NULL)
   {
-    size_t datadir_len = strlen (datadir);
+    size_t datadir_len = strlen (datadir) + 1;
 
     if (datadir_len >= buffer_size)
       return (ENOMEM);
 
     sstrncpy (buffer, datadir, buffer_size);
+    buffer[datadir_len - 1] = '/';
+    buffer[datadir_len] = 0;
+
     buffer += datadir_len;
     buffer_size -= datadir_len;
   }
@@ -236,6 +241,8 @@ static int rc_config (oconfig_item_t *ci)
       status = cf_util_get_string (child, &daemon_address);
     else if (strcasecmp ("CreateFiles", key) == 0)
       status = cf_util_get_boolean (child, &config_create_files);
+    else if (strcasecmp ("CreateFilesAsync", key) == 0)
+      status = cf_util_get_boolean (child, &rrdcreate_config.async);
     else if (strcasecmp ("CollectStatistics", key) == 0)
       status = cf_util_get_boolean (child, &config_collect_stats);
     else if (strcasecmp ("StepSize", key) == 0)
@@ -453,6 +460,8 @@ static int rc_write (const data_set_t *ds, const value_list_t *vl,
             filename);
         return (-1);
       }
+      else if (rrdcreate_config.async)
+        return (0);
     }
   }