Changeset 1064 in MondoRescue for branches/stable/mondo/src/lib/mr_msg.c
- Timestamp:
- Jan 23, 2007, 1:09:32 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/lib/mr_msg.c
r1061 r1064 10 10 */ 11 11 12 #ifndef _GNU_SOURCE 13 #define _GNU_SOURCE 14 #endif 12 15 #include <stdio.h> 13 16 #include <stdarg.h> 17 #include <stdlib.h> 14 18 15 19 static int mr_loglevel = 0; … … 43 47 * but through other functions 44 48 */ 45 void _mr_msg(int debug, const char *file, const char *function, int line, const char *fmt, va_list args) {49 void _mr_msg(int debug, const char *file, const char *function, int line, const char *fmt, ...) { 46 50 47 51 int i = 0; 48 52 int res = 0; 49 53 FILE *fout = NULL; 54 va_list args; 50 55 51 56 if (mr_logfile == NULL) { … … 58 63 return; 59 64 } 65 va_start(args,fmt); 60 66 61 67 // add 2 spaces to distinguish log levels … … 67 73 if (vfprintf(fout, fmt, args) < 0) { 68 74 fprintf(stderr,"Unable to print to %s\n",mr_logfile); 69 return;70 75 } 71 76 … … 74 79 fprintf(stderr,"Unable to close %s\n",mr_logfile); 75 80 } 81 va_end(args); 76 82 } 77 83 } 78 84 79 void mr_msg(int level, const char *fmt, va_list args) {85 void mr_msg(int level, const char *fmt, ...) { 80 86 87 va_list args; 88 89 va_start(args,fmt); 81 90 _mr_msg(level, __FILE__, __FUNCTION__, __LINE__, fmt, args); 91 va_end(args); 82 92 }
Note:
See TracChangeset
for help on using the changeset viewer.