summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/packet.c b/packet.c
index ff22be68f..1dda4a294 100644
--- a/packet.c
+++ b/packet.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: packet.c,v 1.155 2008/06/13 09:44:36 deraadt Exp $ */ 1/* $OpenBSD: packet.c,v 1.156 2008/07/04 23:08:25 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1475,16 +1475,19 @@ packet_write_poll(void)
1475 1475
1476 if (len > 0) { 1476 if (len > 0) {
1477 len = write(connection_out, buffer_ptr(&output), len); 1477 len = write(connection_out, buffer_ptr(&output), len);
1478 if (len <= 0) { 1478 if (len == -1) {
1479 if (errno == EAGAIN || errno == EWOULDBLOCK) 1479 if (errno == EINTR || errno == EAGAIN ||
1480 errno == EWOULDBLOCK)
1480 return; 1481 return;
1481 else 1482 fatal("Write failed: %.100s", strerror(errno));
1482 fatal("Write failed: %.100s", strerror(errno));
1483 } 1483 }
1484 if (len == 0)
1485 fatal("Write connection closed");
1484 buffer_consume(&output, len); 1486 buffer_consume(&output, len);
1485 } 1487 }
1486} 1488}
1487 1489
1490
1488/* 1491/*
1489 * Calls packet_write_poll repeatedly until all pending output data has been 1492 * Calls packet_write_poll repeatedly until all pending output data has been
1490 * written. 1493 * written.