From: Steve Dickson Date: Mon, 19 Jul 2010 18:48:37 +0000 (-0400) Subject: Removed warnings from nfssvc.c X-Git-Tag: nfs-utils-1-2-3-rc5~15 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=b594ee2b2a1b9c0c5823a7af279488f113f91be4;p=nfs-utils.git Removed warnings from nfssvc.c 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 --- diff --git a/utils/nfsd/nfssvc.c b/utils/nfsd/nfssvc.c index 60232b8..34c67ca 100644 --- a/utils/nfsd/nfssvc.c +++ b/utils/nfsd/nfssvc.c @@ -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;