]> andersk Git - openssh.git/blobdiff - packet.c
- OpenBSD CVS Sync
[openssh.git] / packet.c
index ff22be68f4c49b1d9658149e52d4b28c50e46264..1dda4a29458a1b66fd26cd36521960f664c1a397 100644 (file)
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: packet.c,v 1.155 2008/06/13 09:44:36 deraadt Exp $ */
+/* $OpenBSD: packet.c,v 1.156 2008/07/04 23:08:25 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1475,16 +1475,19 @@ packet_write_poll(void)
 
        if (len > 0) {
                len = write(connection_out, buffer_ptr(&output), len);
-               if (len <= 0) {
-                       if (errno == EAGAIN || errno == EWOULDBLOCK)
+               if (len == -1) {
+                       if (errno == EINTR || errno == EAGAIN ||
+                           errno == EWOULDBLOCK)
                                return;
-                       else
-                               fatal("Write failed: %.100s", strerror(errno));
+                       fatal("Write failed: %.100s", strerror(errno));
                }
+               if (len == 0)
+                       fatal("Write connection closed");
                buffer_consume(&output, len);
        }
 }
 
+
 /*
  * Calls packet_write_poll repeatedly until all pending output data has been
  * written.
This page took 0.025705 seconds and 4 git commands to generate.