]> andersk Git - openssh.git/blobdiff - atomicio.c
- (stevesk) OpenSSH CVS update:
[openssh.git] / atomicio.c
index 321af513aeffbd6139553f25560a6e09cdf73191..29ff16c44e6227213bca7c12bfaa8da115be12ca 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999 Theo de Raadt
+ * Copyright (c) 1995,1999 Theo de Raadt
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -24,7 +24,7 @@
  */
 
 #include "includes.h"
-RCSID("$Id$");
+RCSID("$OpenBSD: atomicio.c,v 1.7 2000/10/18 18:04:02 markus Exp $");
 
 #include "xmalloc.h"
 #include "ssh.h"
@@ -33,19 +33,24 @@ RCSID("$Id$");
  * ensure all of data on socket comes through. f==read || f==write
  */
 ssize_t
-atomicio(f, fd, s, n)
+atomicio(f, fd, _s, n)
        ssize_t (*f) ();
        int fd;
-       void *s;
+       void *_s;
        size_t n;
 {
+       char *s = _s;
        ssize_t res, pos = 0;
 
        while (n > pos) {
-               res = (f) (fd, (char*)s + pos, n - pos);
+               res = (f) (fd, s + pos, n - pos);
                switch (res) {
                case -1:
+#ifdef EWOULDBLOCK
+                       if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)
+#else
                        if (errno == EINTR || errno == EAGAIN)
+#endif
                                continue;
                case 0:
                        return (res);
This page took 0.033312 seconds and 4 git commands to generate.