sdpd(8): Raise WARNS to 2 and fix warnings.
authorSascha Wildner <saw@online.de>
Thu, 5 Dec 2013 03:12:00 +0000 (04:12 +0100)
committerSascha Wildner <saw@online.de>
Thu, 5 Dec 2013 03:12:00 +0000 (04:12 +0100)
usr.sbin/sdpd/Makefile
usr.sbin/sdpd/server.c

index 94bc8f7..862f011 100644 (file)
@@ -1,12 +1,11 @@
 # $NetBSD: Makefile,v 1.3 2007/05/28 12:06:41 tls Exp $
-# $DragonFly: src/usr.sbin/sdpd/Makefile,v 1.1 2008/01/06 21:51:30 hasso Exp $
 
 PROG=          sdpd
 MAN=           sdpd.8
 SRCS=          bgd.c dun.c ftrn.c hf.c hset.c irmc.c irmc_command.c lan.c \
                log.c main.c opush.c profile.c provider.c sar.c scr.c \
                sd.c server.c sp.c srr.c ssar.c ssr.c sur.c uuid.c
-WARNS?=                1
+WARNS?=                2
 
 CFLAGS+=       -I${.CURDIR}/../../sys
 
index ba339c5..a012c2e 100644 (file)
@@ -88,10 +88,10 @@ static int32_t      server_process_request          (server_p srv, int32_t fd);
 static int32_t server_send_error_response      (server_p srv, int32_t fd,
                                                 uint16_t error);
 static void    server_close_fd                 (server_p srv, int32_t fd);
-#if 0
+#if 0 /* XXX */
 static int     server_auth_check               (server_p srv, struct sockcred *cred);
-#endif
 static int     server_auth_check               (server_p srv, struct cmsgcred *cred);
+#endif
 
 /*
  * Initialize server
@@ -427,7 +427,9 @@ server_process_request(server_p srv, int32_t fd)
        struct msghdr   msg;
        struct iovec    iov;
        int32_t         len, error;
+#if 0 /* XXX */
        struct cmsghdr  *cmsg;
+#endif
 
        assert(srv->imtu > 0);
        assert(srv->req != NULL);
@@ -464,7 +466,7 @@ server_process_request(server_p srv, int32_t fd)
                return (-1);
        }
 
-#if XXX
+#if 0 /* XXX */
        if ((cmsg = CMSG_FIRSTHDR(&msg)) != NULL
            && cmsg->cmsg_level == SOL_SOCKET
            && cmsg->cmsg_type == SCM_CREDS
@@ -478,7 +480,7 @@ server_process_request(server_p srv, int32_t fd)
                    server_auth_check(srv, (struct sockcred *)CMSG_DATA(cmsg));
 #endif
 #else
-srv->fdidx[fd].priv = 1;
+       srv->fdidx[fd].priv = 1;
 #endif
 
        if (len >= sizeof(*pdu)
@@ -636,6 +638,7 @@ server_close_fd(server_p srv, int32_t fd)
        }
 }
 
+#if 0 /* XXX */
 static int
 /*server_auth_check(server_p srv, struct sockcred *cred)*/
 server_auth_check(server_p srv, struct cmsgcred *cred)
@@ -670,3 +673,4 @@ server_auth_check(server_p srv, struct cmsgcred *cred)
 
        return 0;
 }
+#endif