]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Removed warnings from nfssvc.c
authorSteve Dickson <steved@redhat.com>
Mon, 19 Jul 2010 18:48:37 +0000 (14:48 -0400)
committerSteve Dickson <steved@redhat.com>
Mon, 9 Aug 2010 13:57:02 +0000 (09:57 -0400)
nfssvc.c:184: warning: comparison between signed and unsigned integer expressions
nfssvc.c: In function 'nfssvc_setvers':
nfssvc.c:254: warning: comparison between signed and unsigned integer expressions
nfssvc.c: In function 'nfssvc_threads':
nfssvc.c:280: warning: comparison between signed and unsigned integer expressions

Signed-off-by: Steve Dickson <steved@redhat.com>
utils/nfsd/nfssvc.c

index 60232b88a935943a67fe55a38d4796fcab0b154b..34c67ca11b927ff6201e2d6b61a2e9c8c605ae7b 100644 (file)
@@ -181,7 +181,7 @@ nfssvc_setfds(const struct addrinfo *hints, const char *node, const char *port)
                }
 
                snprintf(buf, sizeof(buf), "%d\n", sockfd); 
-               if (write(fd, buf, strlen(buf)) != strlen(buf)) {
+               if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf)) {
                        /*
                         * this error may be common on older kernels that don't
                         * support IPv6, so turn into a debug message.
@@ -251,7 +251,7 @@ nfssvc_setvers(unsigned int ctlbits, int minorvers4)
        }
        xlog(D_GENERAL, "Writing version string to kernel: %s", buf);
        snprintf(ptr+off, sizeof(buf) - off, "\n");
-       if (write(fd, buf, strlen(buf)) != strlen(buf))
+       if (write(fd, buf, strlen(buf)) != (ssize_t)strlen(buf))
                xlog(L_ERROR, "Setting version failed: errno %d (%m)", errno);
 
        close(fd);
@@ -277,7 +277,7 @@ nfssvc_threads(unsigned short port, const int nrservs)
                snprintf(buf, sizeof(buf), "%d\n", nrservs);
                n = write(fd, buf, strlen(buf));
                close(fd);
-               if (n != strlen(buf))
+               if (n != (ssize_t)strlen(buf))
                        return -1;
                else
                        return 0;