summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorSteve Dickson <steved@redhat.com>2010-10-13 10:15:12 -0400
committerSteve Dickson <steved@redhat.com>2010-10-13 10:26:09 -0400
commit9afbdbad4436df6f7a5a501c6e4db04c3a5bbb08 (patch)
tree34d2c9bbd78d4a7fcba5cf385491a08f8b1bbe23 /support
parentc117b7a1f29db65d139824ba5bab2a58bf5609e2 (diff)
downloadnfs-utils-9afbdbad4436df6f7a5a501c6e4db04c3a5bbb08.tar.gz
nfs-utils-9afbdbad4436df6f7a5a501c6e4db04c3a5bbb08.tar.xz
nfs-utils-9afbdbad4436df6f7a5a501c6e4db04c3a5bbb08.zip
Fix style nits in atomicio.c
Signed-off-by: Jim Rees <rees@umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support')
-rw-r--r--support/nfs/atomicio.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/support/nfs/atomicio.c b/support/nfs/atomicio.c
index 1fb1ff9..5e760e6 100644
--- a/support/nfs/atomicio.c
+++ b/support/nfs/atomicio.c
@@ -28,25 +28,15 @@
#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;
}