- int status;
-
- status = rrdc_connect (opt_daemon);
- if (status != 0)
- {
- rrd_set_error("Unable to connect to opt_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 opt_daemon: %s",
- (status < 0)
- ? "Internal error"
- : rrd_strerror (status));
- }
- else
- {
- rc = 0;
- }
-
- rrdc_disconnect ();
- goto out;
- } /* if (opt_daemon != NULL) */
+ rc = rrdc_update (argv[optind], /* file */
+ argc - optind - 1, /* values_num */
+ (void *) (argv + optind + 1)); /* values */
+ if (rc > 0)
+ rrd_set_error("Failed sending the values to rrdcached: %s",
+ rrd_strerror (rc));
+ }