]> andersk Git - openssh.git/blobdiff - atomicio.c
- (bal) Added MAP_FAILED to allow AIX and Trusted HP to compile.
[openssh.git] / atomicio.c
index f9a364878c47226efad7cff34ab1112401da418e..47161eb3a1e3175ebbbd056e7ad9f5f96ba0dd4c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999 Theo de Raadt
+ * Copyright (c) 1995,1999 Theo de Raadt.  All rights reserved.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  */
 
 #include "includes.h"
-RCSID("$Id$");
+RCSID("$OpenBSD: atomicio.c,v 1.10 2001/05/08 22:48:07 markus Exp $");
 
-#include "xmalloc.h"
-#include "ssh.h"
+#include "atomicio.h"
 
 /*
  * ensure all of data on socket comes through. f==read || f==write
@@ -43,10 +42,14 @@ atomicio(f, fd, _s, n)
        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.302249 seconds and 4 git commands to generate.