Changeset 1061 in MondoRescue for branches/stable/mondo/src/lib/mr_msg.c
- Timestamp:
- Jan 18, 2007, 1:47:59 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/mondo/src/lib/mr_msg.c
r1054 r1061 30 30 if ((fout = fopen(mr_logfile, "w")) == NULL) { 31 31 fprintf(stderr,"Unable to write to %s\n",mr_logfile); 32 fprintf(stderr,"Logging desactivated\n" ,mr_logfile);32 fprintf(stderr,"Logging desactivated\n"); 33 33 mr_msg_close(); 34 34 } … … 41 41 /* 42 42 * Function that log a message. Not called directly 43 * but through macros in mr_msg.h43 * but through other functions 44 44 */ 45 void _mr_msg(int debug, const char *file, const char *function, int line, const char *fmt, ...) {45 void _mr_msg(int debug, const char *file, const char *function, int line, const char *fmt, va_list args) { 46 46 47 47 int i = 0; 48 48 int res = 0; 49 49 FILE *fout = NULL; 50 va_list args;51 50 52 51 if (mr_logfile == NULL) { … … 66 65 fprintf(fout, "%s->%s#%d: ", file, function, line); 67 66 } 68 va_start(args, fmt);69 67 if (vfprintf(fout, fmt, args) < 0) { 70 68 fprintf(stderr,"Unable to print to %s\n",mr_logfile); 69 return; 71 70 } 72 va_end(args);73 71 74 72 fprintf(fout, "\n"); … … 79 77 } 80 78 81 void mr_msg(int level, const char *f ormat, ...) {79 void mr_msg(int level, const char *fmt, va_list args) { 82 80 83 va_list args; 84 va_start(args, format); 85 _mr_msg(level, __FILE__, __FUNCTION__, __LINE__, format, args); 86 va_end(args); 81 _mr_msg(level, __FILE__, __FUNCTION__, __LINE__, fmt, args); 87 82 }
Note:
See TracChangeset
for help on using the changeset viewer.