Changeset 1735 for zzuf/trunk/src/debug.c
- Timestamp:
- Feb 2, 2007, 12:29:27 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/src/debug.c
r1730 r1735 18 18 19 19 #include "config.h" 20 21 /* Do we want our debug() call to be safe wrt. signals? */22 #define SAFE_FUNCTION23 20 24 21 #if defined HAVE_STDINT_H … … 53 50 i /= base; \ 54 51 } \ 55 write(fd, b + 1, buf + 127 - b); \52 write(fd, b + 1, (int)(buf + 127 - b)); \ 56 53 } while(0) 57 54 58 55 void _zz_debug(char const *format, ...) 59 56 { 60 #ifdef SAFE_FUNCTION61 57 static char const *hex2char = "0123456789abcdef"; 62 58 char const *f; 63 #endif64 59 va_list args; 65 60 int saved_errno; … … 70 65 saved_errno = errno; 71 66 va_start(args, format); 72 #ifdef SAFE_FUNCTION 67 68 #if 0 69 /* This function's code is equivalent to the following *printf calls, 70 * except it only uses signal-safe functions */ 71 fprintf(stderr, "** zzuf debug ** "); 72 vfprintf(stderr, format, args); 73 fprintf(stderr, "\n"); 74 #endif 75 73 76 write(_zz_debugfd, "** zzuf debug ** ", 17); 74 77 for(f = format; *f; f++) … … 161 164 } 162 165 write(_zz_debugfd, "\n", 1); 163 #else164 fprintf(stderr, "** zzuf debug ** ");165 vfprintf(stderr, format, args);166 fprintf(stderr, "\n");167 #endif168 166 va_end(args); 169 167 errno = saved_errno; 170 168 } 171
Note: See TracChangeset
for help on using the changeset viewer.