From c8c6688d16d19426ae69a454c3e25511a4aad48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yves=20Rutschl=C3=A9?= Date: Wed, 10 Jan 2018 22:10:19 +0000 Subject: [PATCH] add file and line number upon error messages --- common.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common.h b/common.h index 1e31345..9da9c6b 100644 --- a/common.h +++ b/common.h @@ -37,13 +37,14 @@ #define CHECK_RES_DIE(res, str) \ if (res == -1) { \ + fprintf(stderr, "%s:%d:", __FILE__, __LINE__); \ perror(str); \ exit(1); \ } #define CHECK_RES_RETURN(res, str) \ if (res == -1) { \ - log_message(LOG_CRIT, "%s:%d:%s\n", str, errno, strerror(errno)); \ + log_message(LOG_CRIT, "%s:%d:%s:%d:%s\n", __FILE__, __LINE__, str, errno, strerror(errno)); \ return res; \ }