[vte] [stream] Handle eof situation
- From: Behdad Esfahbod <behdad src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vte] [stream] Handle eof situation
- Date: Wed, 16 Sep 2009 02:22:56 +0000 (UTC)
commit 1ea043ed2df31522c670b6bfba8cf1c9537ce61e
Author: Behdad Esfahbod <behdad behdad org>
Date: Mon Sep 14 15:12:43 2009 -0400
[stream] Handle eof situation
src/vtestream-file.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/vtestream-file.h b/src/vtestream-file.h
index 160915e..e2a407d 100644
--- a/src/vtestream-file.h
+++ b/src/vtestream-file.h
@@ -31,12 +31,15 @@ _xread (int fd, char *data, gsize len)
while (len) {
ret = read (fd, data, len);
+ g_message ("%d %d", len, ret);
if (G_UNLIKELY (ret == (gsize) -1)) {
if (errno == EINTR)
continue;
else
break;
}
+ if (G_UNLIKELY (ret == 0))
+ break;
data += ret;
len -= ret;
total += ret;
@@ -59,6 +62,8 @@ _xwrite (int fd, const char *data, gsize len)
else
break;
}
+ if (G_UNLIKELY (ret == 0))
+ break;
data += ret;
len -= ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]