[pacman-dev] Add line number to RET_ERR{,_VOID}

Message ID 20200309025920.78670-1-allan@archlinux.org
State New
Headers show
Series
  • [pacman-dev] Add line number to RET_ERR{,_VOID}
Related show

Commit Message

Allan McRae March 9, 2020, 2:59 a.m. UTC
Following the example of the recently added GOTO_ERR, adding the line number
in addition to the function name in our debug messages is potentially useful.

Signed-off-by: Allan McRae <allan@archlinux.org>
---
 lib/libalpm/util.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h
index ce80b32b..37bfba9d 100644
--- a/lib/libalpm/util.h
+++ b/lib/libalpm/util.h
@@ -62,12 +62,12 @@  void _alpm_alloc_fail(size_t size);
 #define ASSERT(cond, action) do { if(!(cond)) { action; } } while(0)
 
 #define RET_ERR_VOID(handle, err) do { \
-	_alpm_log(handle, ALPM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerror(err)); \
+	_alpm_log(handle, ALPM_LOG_DEBUG, "returning error %d from %s:%d : %s\n", err, __func__, __LINE__, alpm_strerror(err)); \
 	(handle)->pm_errno = (err); \
 	return; } while(0)
 
 #define RET_ERR(handle, err, ret) do { \
-	_alpm_log(handle, ALPM_LOG_DEBUG, "returning error %d from %s : %s\n", err, __func__, alpm_strerror(err)); \
+	_alpm_log(handle, ALPM_LOG_DEBUG, "returning error %d from %s:%d : %s\n", err, __func__, __LINE__, alpm_strerror(err)); \
 	(handle)->pm_errno = (err); \
 	return (ret); } while(0)