[Mit-cadr-cvs] r329 - trunk/emulator/chaos

ggilley at common-lisp.net ggilley at common-lisp.net
Mon Nov 19 06:41:49 UTC 2012


Author: ggilley
Date: Sun Nov 18 22:41:48 2012
New Revision: 329

Log:
fix a couple of warnings

Modified:
   trunk/emulator/chaos/MINI.c
   trunk/emulator/chaos/chlib.c

Modified: trunk/emulator/chaos/MINI.c
==============================================================================
--- trunk/emulator/chaos/MINI.c	Sun Nov 18 22:16:14 2012	(r328)
+++ trunk/emulator/chaos/MINI.c	Sun Nov 18 22:41:48 2012	(r329)
@@ -10,6 +10,7 @@
 
 #include <stdio.h>
 #include <fcntl.h>
+#include <time.h>
 
 #include <sys/stat.h>
 #include <sys/ioctl.h>
@@ -114,7 +115,8 @@
 				strftime(tbuf, sizeof(tbuf), "%D %T", ptm);
 				length = sprintf(pout.cp_data, "%s%c%s",
 						 p.cp_data, 0215, tbuf);
-				write(1, (char *)&pout, length + 1);
+				while (write(1, (char *)&pout, length + 1) < 0)
+					usleep(10000);
 				binary = p.cp_op & 1;
 			}
 

Modified: trunk/emulator/chaos/chlib.c
==============================================================================
--- trunk/emulator/chaos/chlib.c	Sun Nov 18 22:16:14 2012	(r328)
+++ trunk/emulator/chaos/chlib.c	Sun Nov 18 22:41:48 2012	(r329)
@@ -103,7 +103,11 @@
 		memcpy(&buffer[4 + sizeof(rfc)+rfc.co_length], rfc.co_data, rfc.co_length);
 
 	fprintf(stderr, "chopen: write\n"); fflush(stderr);
-	write(3, buffer, len);
+	if (write(3, buffer, len) < 0)
+	{
+		perror("chopen request");
+		fflush(stderr);
+	}
 
 	/* read back status and connection fd */
 	memset(cmsgbuf, 0, sizeof(cmsgbuf));




More information about the mit-cadr-cvs mailing list