+ if ((tmplt != NULL) && (daemon != NULL))
+ {
+ rrd_set_error("The caching daemon cannot be used together with "
+ "templates yet.");
+ goto out;
+ }
+
+ if (daemon != NULL)
+ {
+ int status;
+
+ status = rrdc_connect (daemon);
+ if (status != 0)
+ {
+ rrd_set_error("Unable to connect to daemon: %s",
+ (status < 0)
+ ? "Internal error"
+ : rrd_strerror (status));
+ goto out;
+ }
+
+ status = rrdc_update (/* file = */ argv[optind],
+ /* values_num = */ argc - optind - 1,
+ /* values = */ (void *) (argv + optind + 1));
+ if (status != 0)
+ {
+ rrd_set_error("Failed sending the values to the daemon: %s",
+ (status < 0)
+ ? "Internal error"
+ : rrd_strerror (status));
+ }
+
+ rrdc_disconnect ();
+ goto out;
+ } /* if (daemon != NULL) */
+