Changes in uspace/app/klog/klog.c [7dfd339:d9fae235] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/klog/klog.c
r7dfd339 rd9fae235 43 43 #include <event.h> 44 44 #include <errno.h> 45 #include <str_error.h>46 45 #include <io/klog.h> 47 46 48 #define NAME "klog" 49 #define LOG_FNAME "/log/klog" 47 #define NAME "klog" 50 48 51 49 /* Pointer to klog area */ 52 50 static wchar_t *klog; 53 51 static size_t klog_length; 54 55 static FILE *log;56 52 57 53 static void interrupt_received(ipc_callid_t callid, ipc_call_t *call) … … 62 58 size_t i; 63 59 64 for (i = klog_len - klog_stored; i < klog_len; i++) { 65 wchar_t ch = klog[(klog_start + i) % klog_length]; 66 67 putchar(ch); 68 69 if (log != NULL) 70 fputc(ch, log); 71 } 72 73 if (log != NULL) { 74 fflush(log); 75 fsync(fileno(log)); 76 } 60 for (i = klog_len - klog_stored; i < klog_len; i++) 61 putchar(klog[(klog_start + i) % klog_length]); 77 62 } 78 63 … … 106 91 } 107 92 108 /*109 * Mode "a" would be definitively much better here, but it is110 * not well supported by the FAT driver.111 *112 */113 log = fopen(LOG_FNAME, "w");114 if (log == NULL)115 printf("%s: Unable to create log file %s (%s)\n", NAME, LOG_FNAME,116 str_error(errno));117 118 93 async_set_interrupt_received(interrupt_received); 119 94 klog_update();
Note:
See TracChangeset
for help on using the changeset viewer.