]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Fix style nits in atomicio.c
authorSteve Dickson <steved@redhat.com>
Wed, 13 Oct 2010 14:15:12 +0000 (10:15 -0400)
committerSteve Dickson <steved@redhat.com>
Wed, 13 Oct 2010 14:26:09 +0000 (10:26 -0400)
Signed-off-by: Jim Rees <rees@umich.edu>
Signed-off-by: Steve Dickson <steved@redhat.com>
support/nfs/atomicio.c

index 1fb1ff9ce5ba358237dff328fcf284b4eb5c57be..5e760e6b2222d8726dd35e18b752f7f15d619c8b 100644 (file)
 #include <unistd.h>
 #include <errno.h>
 
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif /* HAVE_CONFIG_H */
-
 /*
  * ensure all of data on socket comes through. f==read || f==write
  */
-ssize_t
-atomicio(
-       ssize_t (*f) (int, void*, size_t),
-       int fd,
-       void *_s,
-       size_t n)
+ssize_t atomicio(ssize_t(*f) (int, void *, size_t), int fd, void *_s, size_t n)
 {
        char *s = _s;
-       ssize_t res;
-       size_t pos = 0;
+       ssize_t res, pos = 0;
 
-       while (n > pos) {
+       while ((ssize_t)n > pos) {
                res = (f) (fd, s + pos, n - pos);
                switch (res) {
                case -1:
@@ -54,11 +44,11 @@ atomicio(
                                continue;
                case 0:
                        if (pos != 0)
-                               return (pos);
-                       return (res);
+                               return pos;
+                       return res;
                default:
                        pos += res;
                }
        }
-       return (pos);
+       return pos;
 }