| version 1.1, 2012/02/21 16:23:02 | version 1.1.1.3, 2012/10/09 09:29:52 | 
| Line 19 | Line 19 | 
 |  |  | 
 | #include <stdarg.h> | #include <stdarg.h> | 
 |  |  | 
| void    error(int, const char *, ...)  __printflike(2, 3) __attribute__((__noreturn__)); | /* | 
| void    errorx(int, const char *, ...)  __printflike(2, 3) __attribute__((__noreturn__)); | * We wrap error/errorx and warn/warnx so that the same output can | 
| void    warning(const char *, ...) __printflike(1, 2); | * go to the debug file, if there is one. | 
| void    warningx(const char *, ...) __printflike(1, 2); | */ | 
|  | #if defined(SUDO_ERROR_WRAP) && SUDO_ERROR_WRAP == 0 | 
|  | # if defined(__GNUC__) && __GNUC__ == 2 | 
|  | #  define error(rval, fmt...) error2((rval), fmt) | 
|  | #  define errorx(rval, fmt...) errorx2((rval), fmt) | 
|  | #  define warning(fmt...) warning2(fmt) | 
|  | #  define warningx(fmt...) warningx2(fmt) | 
|  | # else | 
|  | #  define error(rval, ...) error2((rval), __VA_ARGS__) | 
|  | #  define errorx(rval, ...) errorx2((rval), __VA_ARGS__) | 
|  | #  define warning(...) warning2(__VA_ARGS__) | 
|  | #  define warningx(...) warningx2(__VA_ARGS__) | 
|  | # endif /* __GNUC__ == 2 */ | 
|  | #else /* SUDO_ERROR_WRAP */ | 
|  | # if defined(__GNUC__) && __GNUC__ == 2 | 
|  | #  define error(rval, fmt...) do {                                             \ | 
|  | sudo_debug_printf2(__func__, __FILE__, __LINE__,                           \ | 
|  | SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO|sudo_debug_subsys, \ | 
|  | fmt);                                                                  \ | 
|  | error2((rval), fmt);                                                       \ | 
|  | } while (0) | 
|  | #  define errorx(rval, fmt...) do {                                            \ | 
|  | sudo_debug_printf2(__func__, __FILE__, __LINE__,                           \ | 
|  | SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|sudo_debug_subsys, fmt);            \ | 
|  | errorx2((rval), fmt);                                                      \ | 
|  | } while (0) | 
|  | #  define warning(fmt...) do {                                                 \ | 
|  | sudo_debug_printf2(__func__, __FILE__, __LINE__,                           \ | 
|  | SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO|sudo_debug_subsys, \ | 
|  | fmt);                                                                  \ | 
|  | warning2(fmt);                                                             \ | 
|  | } while (0) | 
|  | #  define warningx(fmt...) do {                                                \ | 
|  | sudo_debug_printf2(__func__, __FILE__, __LINE__,                           \ | 
|  | SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|sudo_debug_subsys, fmt);            \ | 
|  | warningx2(fmt);                                                            \ | 
|  | } while (0) | 
|  | # else | 
|  | #  define error(rval, ...) do {                                                \ | 
|  | sudo_debug_printf2(__func__, __FILE__, __LINE__,                           \ | 
|  | SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO|sudo_debug_subsys, \ | 
|  | __VA_ARGS__);                                                          \ | 
|  | error2((rval), __VA_ARGS__);                                               \ | 
|  | } while (0) | 
|  | #  define errorx(rval, ...) do {                                               \ | 
|  | sudo_debug_printf2(__func__, __FILE__, __LINE__,                           \ | 
|  | SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO|sudo_debug_subsys, __VA_ARGS__);    \ | 
|  | errorx2((rval), __VA_ARGS__);                                              \ | 
|  | } while (0) | 
|  | #  define warning(...) do {                                                    \ | 
|  | sudo_debug_printf2(__func__, __FILE__, __LINE__,                           \ | 
|  | SUDO_DEBUG_WARN|SUDO_DEBUG_LINENO|SUDO_DEBUG_ERRNO|sudo_debug_subsys,  \ | 
|  | __VA_ARGS__);                                                          \ | 
|  | warning2(__VA_ARGS__);                                                     \ | 
|  | } while (0) | 
|  | #  define warningx(...) do {                                                   \ | 
|  | sudo_debug_printf2(__func__, __FILE__, __LINE__,                           \ | 
|  | SUDO_DEBUG_WARN|SUDO_DEBUG_LINENO|sudo_debug_subsys, __VA_ARGS__);     \ | 
|  | warningx2(__VA_ARGS__);                                                    \ | 
|  | } while (0) | 
|  | # endif /* __GNUC__ == 2 */ | 
|  | #endif /* SUDO_ERROR_WRAP */ | 
|  |  | 
|  | void    error2(int, const char *, ...)  __printflike(2, 3) __attribute__((__noreturn__)); | 
|  | void    errorx2(int, const char *, ...)  __printflike(2, 3) __attribute__((__noreturn__)); | 
|  | void    warning2(const char *, ...) __printflike(1, 2); | 
|  | void    warningx2(const char *, ...) __printflike(1, 2); | 
 |  |  | 
 | #endif /* _SUDO_ERROR_H_ */ | #endif /* _SUDO_ERROR_H_ */ |