[kaffe] CVS kaffe (guilhem): Use KWRITE instead of write in debug.c

Kaffe CVS cvs-commits at kaffe.org
Sat Aug 28 08:33:42 PDT 2004


PatchSet 5113 
Date: 2004/08/28 15:29:53
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Use KWRITE instead of write in debug.c

        * kaffe/kaffevm/debug.c
        (kaffe_dprintf): Use KWRITE instead of write.

Members: 
	ChangeLog:1.2669->1.2670 
	kaffe/kaffevm/debug.c:1.55->1.56 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2669 kaffe/ChangeLog:1.2670
--- kaffe/ChangeLog:1.2669	Fri Aug 27 12:22:00 2004
+++ kaffe/ChangeLog	Sat Aug 28 15:29:53 2004
@@ -1,3 +1,8 @@
+2004-08-28  Alexander Boettcher  <ab764283 at os.inf.tu-dresden.de>
+
+	* kaffe/kaffevm/debug.c
+	(kaffe_dprintf): Use KWRITE instead of write.
+
 2004-08-27  Helmer Kraemer  <hkraemer at freenet.de>
 
 	* kaffe/kaffevm/support.c: moved libffi related stuff ...
Index: kaffe/kaffe/kaffevm/debug.c
diff -u kaffe/kaffe/kaffevm/debug.c:1.55 kaffe/kaffe/kaffevm/debug.c:1.56
--- kaffe/kaffe/kaffevm/debug.c:1.55	Mon Aug  2 10:44:56 2004
+++ kaffe/kaffe/kaffevm/debug.c	Sat Aug 28 15:29:55 2004
@@ -36,6 +36,7 @@
 #include "gtypes.h"
 #include "gc.h"
 #include "debug.h"
+#include "jsyscall.h"
 
 /* Default debugging mask to use (if debug is enabled) */
 #define DEFAULT_DEBUG_MASK	DBG_NONE
@@ -388,6 +389,8 @@
 	int n;
 	int max;
 	va_list args;
+	ssize_t w = 0;
+	int rc;
 
 	va_start(args, fmt);
 	if (!debugBuffer)
@@ -417,13 +420,14 @@
 		 */
 		max = 0;
 		while (max < n) {
-			int w =  write(2,
-				       debugBuffer + max,
-				       (size_t)(n - max));
+                        rc = KWRITE(2,
+                                       debugBuffer + max,
+                                       (size_t)n - max,&w);
+
 			if (w >= 0)
 				/* ignore errors */
 				max += w;
-			else if (errno != SIGINT)
+			else if (rc != SIGINT)
 			  {
 		            /* Stderr should have been closed by another thread.
 			     * We may only exit without printing anything.



More information about the kaffe mailing list