kdebug: Switched to write() for output because it's reentrant)
authorbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Sun, 17 Aug 2008 18:32:46 +0000 (18:32 +0000)
committerbernie <bernie@38d2e660-2303-0410-9eaa-f027e97ec537>
Sun, 17 Aug 2008 18:32:46 +0000 (18:32 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1656 38d2e660-2303-0410-9eaa-f027e97ec537

bertos/drv/kdebug.c

index 1f8725502a9a3d4f601085ab8a0f1dbf992afc02..d929bbbf2cd611ca8adcb0210481f80127cdb655 100644 (file)
 
 
 #if OS_HOSTED
-       #include <stdio.h>
+       #include <unistd.h> // write()
+
        #define KDBG_WAIT_READY()      do { /*nop*/ } while(0)
-       #define KDBG_WRITE_CHAR(c)     do { char __c = (c); write(2, &__c, sizeof(__c)); } while(0)
+       #define KDBG_WRITE_CHAR(c)     do { char __c = (c); write(STDERR_FILENO, &__c, sizeof(__c)); } while(0)
        #define KDBG_MASK_IRQ(old)     do { (void)(old); } while(0)
        #define KDBG_RESTORE_IRQ(old)  do { /*nop*/ } while(0)
        typedef char kdbg_irqsave_t; /* unused */