/* rrdc update <file> <value> [<value> ..] */
if ((argc >= 4) && (strcmp (argv[1], "update") == 0))
{
- status = rrdd_connect (RRDD_SOCK_PATH);
+ status = rrdd_connect (/* path = */ NULL);
if (status != 0)
{
fprintf (stderr, "rrdd_connect failed: %s\n",
}
else
{
- char **argv_copy;
-
- fprintf (stdout, "RRDc 1.0.0 Copyright 2008 by Florian Forster "
- "<octo at verplant.org>\n\n");
+ fprintf (stdout, "RRDc %s Copyright 2008 by Florian Forster "
+ "<octo at verplant.org>\n\n",
+ PACKAGE_VERSION);
fflush (stdout);
- /* Copy argv so we can assure that it is NULL terminated. */
- argv_copy = (char **) malloc (sizeof (char *) * (argc + 1));
- if (argv_copy == NULL)
- {
- fprintf (stderr, "malloc failed.\n");
- return (1);
- }
- memcpy (argv_copy, argv, sizeof (char *) * argc);
- /* argv_copy[0] = "rrdtool"; */
- argv_copy[argc] = NULL;
+ assert (argv[argc] == NULL);
- status = execvp ("rrdtool", argv_copy);
+ status = execvp ("rrdtool", argv);
fprintf (stderr, "execv failed with status %i.\n", status);
return (1);
}