openbsd does not know EPROTO it seems
[rrdtool.git] / src / rrd_client.c
index e3790f6..3347b82 100644 (file)
@@ -492,7 +492,7 @@ int rrdc_is_connected(const char *daemon_addr) /* {{{ */
      * but it is not specified in the current command.
      * Daemon is only implied in this case if set in ENV
      */
-    if (addr != NULL && ! strcmp(addr,""))
+    if (addr != NULL && strcmp(addr,"") != 0)
       return 1;
     else
       return 0;
@@ -653,12 +653,14 @@ int rrdc_connect (const char *addr) /* {{{ */
 {
   int status = 0;
 
-  if (addr == NULL)
+  if (addr == NULL) {
     addr = getenv (ENV_RRDCACHED_ADDRESS);
+  }
 
-  if (addr == NULL || ! strcmp(addr,""))
+  if (addr == NULL || strcmp(addr,"") == 0) {
     addr = NULL;
     return 0;
+  }
 
   pthread_mutex_lock(&lock);
 
@@ -1493,7 +1495,11 @@ int rrdc_stats_get (rrdc_stats_t **ret_stats) /* {{{ */
   response_free (res);
 
   if (head == NULL)
+#ifdef EPROTO
     return (EPROTO);
+#else
+    return (EINVAL);
+#endif
 
   *ret_stats = head;
   return (0);