chiark / gitweb /
*** empty log message ***
[sympathy.git] / src / util.c
index e8b315ea4725518bfa79df0eea06eba20cfaa8ba..0a74869144b5cc2ae69dd15d22985dd0c1c990eb 100644 (file)
@@ -10,6 +10,12 @@ 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 ***
+ *
  * Revision 1.1  2008/02/13 01:08:38  james
  * *** empty log message ***
  *
@@ -37,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;
@@ -66,7 +75,8 @@ set_blocking (int fd)
   fcntl (fd, F_SETFL, arg);
 }
 
-void raw_termios(struct termios *termios)
+void
+raw_termios (struct termios *termios)
 {
 
   termios->c_iflag = ICRNL | IXON;
@@ -97,12 +107,10 @@ default_termios (struct termios *termios)
 
   memset (termios, 0, sizeof (termios));
 
-  raw_termios(termios);
+  raw_termios (termios);
 
   termios->c_cflag = CS8 | CREAD | CLOCAL;
 
   cfsetispeed (termios, B9600);
   cfsetospeed (termios, B9600);
 }
-
-