src/{lib,}rrdc.c: Make `rrdd_connect' use the default path if path == NULL.
authorFlorian Forster <octo@leeloo.home.verplant.org>
Sun, 22 Jun 2008 08:17:10 +0000 (10:17 +0200)
committerFlorian Forster <octo@leeloo.home.verplant.org>
Sun, 22 Jun 2008 08:17:10 +0000 (10:17 +0200)
src/librrdc.c
src/rrdc.c

index 1a21260..93d9420 100644 (file)
@@ -63,6 +63,9 @@ int rrdd_connect (const char *path)
   struct sockaddr_un sa;
   int status;
 
+  if (path == NULL)
+    path = RRDD_SOCK_PATH;
+
   pthread_mutex_lock (&lock);
 
   if (sh != NULL)
index e24c7aa..0177a64 100644 (file)
@@ -52,7 +52,7 @@ int main (int argc, char **argv)
   /* 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",