Skip to contentSkip to conversation

fix style nits in atomicio.c

PATCH In review Jim Rees 2 participants 2 messages Oct 5, 2010 – Oct 13, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Jim Rees

author
#0 lore raw

PATCH 1/1 fix style nits in atomicio.c

---
 support/nfs/atomicio.c |   20 +++++---------------
 1 files changed, 5 insertions(+), 15 deletions(-)
support/nfs/atomicio.c +5 -15
index 1fb1ff9..8db626e 100644
@@ -28,23 +28,13 @@
 #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) {
 		res = (f) (fd, s + pos, n - pos);
@@ -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;
 }
Signature · 1 line
1.7.0.4