Merge remote-tracking branch 'github/pr/2006'
authorFlorian Forster <octo@collectd.org>
Fri, 28 Oct 2016 05:22:59 +0000 (07:22 +0200)
committerFlorian Forster <octo@collectd.org>
Fri, 28 Oct 2016 05:22:59 +0000 (07:22 +0200)
1  2 
src/daemon/common.c

diff --combined src/daemon/common.c
@@@ -1620,10 -1620,8 +1620,8 @@@ void set_sock_opts (int sockfd) /* {{{ 
        int status;
        int socktype;
  
-       socklen_t socklen = sizeof (socklen_t);
-       int so_keepalive = 1;
-       status = getsockopt (sockfd, SOL_SOCKET, SO_TYPE, &socktype, &socklen);
+       status = getsockopt (sockfd, SOL_SOCKET, SO_TYPE,
+                       &socktype, &(socklen_t) { sizeof (socktype) });
        if (status != 0)
        {
                WARNING ("set_sock_opts: failed to determine socket type");
        if (socktype == SOCK_STREAM)
        {
                status = setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE,
-                               &so_keepalive, sizeof (so_keepalive));
+                               &(int) {1}, sizeof (int));
                if (status != 0)
                        WARNING ("set_sock_opts: failed to set socket keepalive flag");
  
@@@ -1743,7 -1741,7 +1741,7 @@@ int check_capability (int capability) /
        }
  
        cap_header->pid = getpid();
 -      cap_header->version = _LINUX_CAPABILITY_VERSION;
 +      cap_header->version = _LINUX_CAPABILITY_VERSION_3;
        if (capget(cap_header, cap_data) < 0)
        {
                ERROR("check_capability: capget failed");