- if (opt_daemon != NULL)
- {
- int status;
-
- status = rrdc_connect (opt_daemon);
- if (status != 0)
- {
- rrd_set_error ("rrdc_connect failed with status %i.", status);
- return (NULL);
- }
-
- status = rrdc_flush (argv[optind]);
- if (status != 0)
- {
- rrd_set_error ("rrdc_flush (%s) failed with status %i.",
- argv[optind], status);
- return (NULL);
- }
-
- rrdc_disconnect ();
- } /* if (opt_daemon) */
-
+ rrdc_connect (opt_daemon);
+ if (rrdc_is_connected (opt_daemon))
+ info = rrdc_info (argv[optind]);
+ else