]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - utils/statd/sm-notify.c
Add -Wstrict-prototypes to compiler args, and fix warnings caused.
[nfs-utils.git] / utils / statd / sm-notify.c
index 1059a888949cd21984837de1af31683fba90695f..bb67c378e94839254bbb49ec093bef71dda11317 100644 (file)
@@ -86,7 +86,7 @@ static int            addr_get_port(nsm_address *);
 static void            addr_set_port(nsm_address *, int);
 static struct addrinfo *host_lookup(int, const char *);
 void                   nsm_log(int fac, const char *fmt, ...);
-static int             record_pid();
+static int             record_pid(void);
 static void            drop_privs(void);
 static void set_kernel_nsm_state(int state);
 
@@ -251,9 +251,10 @@ notify(void)
                }
        } else {
                struct servent *se;
-               (void) bindresvport(sock, (struct sockaddr_in *) &local_addr);
+               struct sockaddr_in *sin = (struct sockaddr_in *)&local_addr;
+               (void) bindresvport(sock, sin);
                /* try to avoid known ports */
-               se = getservbyport(local_addr.sin_port, "udp");
+               se = getservbyport(sin->sin_port, "udp");
                if (se && retry_cnt < 100) {
                        retry_cnt++;
                        close(sock);
@@ -729,7 +730,7 @@ nsm_log(int fac, const char *fmt, ...)
  * program exits.
  * If file already exists, fail.
  */
-static int record_pid()
+static int record_pid(void)
 {
        char pid[20];
        int fd;