logging: properly cast sockaddr_in to sockaddr for bind in start_syslog_daemon()
authorMichael Adam <obnox@samba.org>
Fri, 25 Nov 2011 15:40:52 +0000 (16:40 +0100)
committerMichael Adam <obnox@samba.org>
Fri, 25 Nov 2011 23:34:53 +0000 (00:34 +0100)
server/ctdb_logging.c

index 2ef2a0b1fb8480e9a3bc1e27fd983bc8409f5e3e..1f7f984961a943d67586a76d2cf22e88ab47365b 100644 (file)
@@ -141,7 +141,9 @@ int start_syslog_daemon(struct ctdb_context *ctdb)
        syslog_sin.sin_port   = htons(CTDB_PORT);
        syslog_sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);    
 
-       if (bind(state->syslog_fd, &syslog_sin, sizeof(syslog_sin)) == -1) {
+       if (bind(state->syslog_fd, (struct sockaddr *)&syslog_sin,
+                sizeof(syslog_sin)) == -1)
+       {
                if (errno == EADDRINUSE) {
                        /* this is ok, we already have a syslog daemon */
                        _exit(0);