mirror of
https://github.com/yrutschle/sslh.git
synced 2025-04-13 23:57:14 +03:00
add file and line number upon error messages
This commit is contained in:
parent
9a85efded5
commit
c8c6688d16
3
common.h
3
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; \
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user