]> andersk Git - gssapi-openssh.git/blobdiff - openssh/atomicio.c
Import of OpenSSH 4.9p1
[gssapi-openssh.git] / openssh / atomicio.c
index f32ff85baf67abf561ea5ed02b9b3a902bf0aa1d..575bf8900ee39e9e3cb89061934b659bd87b52d6 100644 (file)
 #include <errno.h>
 #ifdef HAVE_POLL_H
 #include <poll.h>
+#else
+# ifdef HAVE_SYS_POLL_H
+#  include <sys/poll.h>
+# endif
 #endif
 #include <string.h>
 #include <unistd.h>
@@ -57,13 +61,13 @@ atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
                res = (f) (fd, s + pos, n - pos);
                switch (res) {
                case -1:
-#ifdef EWOULDBLOCK
-                       if (errno == EINTR || errno == EWOULDBLOCK)
-#else
                        if (errno == EINTR)
-#endif
                                continue;
+#ifdef EWOULDBLOCK
+                       if (errno == EAGAIN || errno == EWOULDBLOCK) {
+#else
                        if (errno == EAGAIN) {
+#endif
                                (void)poll(&pfd, 1, -1);
                                continue;
                        }
@@ -103,13 +107,13 @@ atomiciov(ssize_t (*f) (int, const struct iovec *, int), int fd,
                res = (f) (fd, iov, iovcnt);
                switch (res) {
                case -1:
-#ifdef EWOULDBLOCK
-                       if (errno == EINTR || errno == EWOULDBLOCK)
-#else
                        if (errno == EINTR)
-#endif
                                continue;
+#ifdef EWOULDBLOCK
+                       if (errno == EAGAIN || errno == EWOULDBLOCK) {
+#else
                        if (errno == EAGAIN) {
+#endif
                                (void)poll(&pfd, 1, -1);
                                continue;
                        }
This page took 0.049751 seconds and 4 git commands to generate.