aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index bd838b9..0a74869 100644
--- a/src/util.c
+++ b/src/util.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.3 2008/02/13 16:57:29 james
+ * *** empty log message ***
+ *
* Revision 1.2 2008/02/13 09:12:21 james
* *** empty log message ***
*
@@ -40,11 +43,14 @@ wrap_write (int fd, void *buf, int len)
{
int writ;
+ errno = 0;
+
writ = write (fd, buf, len);
+
if (!writ)
return -1;
- if ((writ < 0) && (errno == -EAGAIN))
+ if ((writ < 0) && (errno == EAGAIN))
writ = 0;
return writ;