Imported Upstream version 1.8.5
[debian/sudo] / include / error.h
index fdc1e08bf1d45657e43cda88b9195f764d7da67e..f587b89a5b1a6fc41836912ef3e735344d747430 100644 (file)
 #else /* SUDO_ERROR_WRAP */
 # if defined(__GNUC__) && __GNUC__ == 2
 #  define error(rval, fmt...) do {                                            \
-    sudo_debug_printf2(SUDO_DEBUG_ERROR|sudo_debug_subsys, (fmt));            \
+    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(SUDO_DEBUG_ERROR|sudo_debug_subsys, (fmt));            \
+    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(SUDO_DEBUG_ERROR|sudo_debug_subsys, (fmt));            \
+    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(SUDO_DEBUG_ERROR|sudo_debug_subsys, (fmt));            \
+    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(SUDO_DEBUG_ERROR|sudo_debug_subsys, __VA_ARGS__);      \
+    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(SUDO_DEBUG_ERROR|sudo_debug_subsys, __VA_ARGS__);     \
+    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(SUDO_DEBUG_ERROR|sudo_debug_subsys, __VA_ARGS__);      \
+    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(SUDO_DEBUG_ERROR|sudo_debug_subsys, __VA_ARGS__);     \
+    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 */