]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Merge branch 'collectd-5.4' into collectd-5.5
authorFlorian Forster <octo@collectd.org>
Sun, 28 Jun 2015 13:05:36 +0000 (15:05 +0200)
committerFlorian Forster <octo@collectd.org>
Sun, 28 Jun 2015 13:05:36 +0000 (15:05 +0200)
1  2 
src/daemon/common.c
src/df.c
src/tcpconns.c

index 4720399154cec878b39091bed12ef9129437c3bb,c2849420502846eabcec0c5ab701778275a0bce1..b2448086c53aadc0641b63bf7eef9b51e8c1decf
@@@ -507,18 -438,21 +507,18 @@@ int escape_slashes (char *buffer, size_
                return (0);
        }
  
 -      if (buf_len <= 1)
 -              return (0);
 -
        /* Move one to the left */
 -      if (buf[0] == '/')
 -              memmove (buf, buf + 1, buf_len - 1);
 +      if (buffer[0] == '/')
 +      {
 +              memmove (buffer, buffer + 1, buffer_len);
 +              buffer_len--;
 +      }
  
-       for (i = 0; i < buffer_len - 1; i++)
 -      for (i = 0; i < buf_len; i++)
++      for (i = 0; i < buffer_len; i++)
        {
 -              if (buf[i] == '\0')
 -                      break;
 -              else if (buf[i] == '/')
 -                      buf[i] = '_';
 +              if (buffer[i] == '/')
 +                      buffer[i] = '_';
        }
 -      buf[i] = '\0';
  
        return (0);
  } /* int escape_slashes */
diff --cc src/df.c
Simple merge
diff --cc src/tcpconns.c
index b6a3fdda319c8d75a532ab0073f561f6571f3f04,bf07a2a28b99f69c6c135bec7a1fb55872b7161a..5d4bb6966f98b024e57ffc7fd0956082777212ab
@@@ -979,18 -929,14 +979,20 @@@ static int conn_read (void
    next = (struct inpcb *)CIRCLEQ_FIRST (&table.inpt_queue);
  
    while (next != head)
 +#endif
    {
      /* Read the pcb pointed to by `next' into `inpcb' */
-     kread ((u_long) next, &inpcb, sizeof (inpcb));
+     status = kread ((u_long) next, &inpcb, sizeof (inpcb));
+     if (status != 0)
+       return (-1);
  
      /* Advance `next' */
 +#if defined(__OpenBSD__) || (defined(__NetBSD_Version__) && __NetBSD_Version__ > 699002700)
 +    /* inpt_queue is a TAILQ on OpenBSD */
 +    next = (struct inpcb *)TAILQ_NEXT (&inpcb, inp_queue);
 +#else
      next = (struct inpcb *)CIRCLEQ_NEXT (&inpcb, inp_queue);
 +#endif
  
      /* Ignore sockets, that are not connected. */
  #ifdef __NetBSD__