diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2008-07-04 23:08:26 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2008-07-04 23:08:26 +0000 |
commit | 7cccd8a1a4b783ae1933b6ae39fe7a9c4504ba61 (patch) | |
tree | baff4488a32195b78e8060198d179e8223dc3011 /usr.bin | |
parent | c605125719e9e34461d088dd6c6cfb531e9f6235 (diff) |
handle EINTR in packet_write_poll()l ok dtucker@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/packet.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c index d2865fa592f..bc6c3a133cd 100644 --- a/usr.bin/ssh/packet.c +++ b/usr.bin/ssh/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 @@ -1465,12 +1465,13 @@ packet_write_poll(void) if (len > 0) { len = write(connection_out, buffer_ptr(&output), len); - if (len <= 0) { - if (errno == EAGAIN) + if (len == -1) { + if (errno == EINTR || errno == EAGAIN) 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); } } |