mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-16 05:34:00 -04:00
errno: don’t use ‘_errno’ as a variable name; _ are reserved for use as identifiers
This commit is contained in:
parent
0bda60aacc
commit
555f751f94
4 changed files with 29 additions and 28 deletions
6
config.c
6
config.c
|
|
@ -148,13 +148,13 @@ static_assert(ALEN(url_binding_action_map) == BIND_ACTION_URL_COUNT,
|
|||
|
||||
#define LOG_AND_NOTIFY_ERRNO(...) \
|
||||
do { \
|
||||
int _errno = errno; \
|
||||
int errno_copy = errno; \
|
||||
LOG_ERRNO(__VA_ARGS__); \
|
||||
int len = snprintf(NULL, 0, __VA_ARGS__); \
|
||||
int errno_len = snprintf(NULL, 0, ": %s", strerror(_errno)); \
|
||||
int errno_len = snprintf(NULL, 0, ": %s", strerror(errno_copy)); \
|
||||
char *text = xmalloc(len + errno_len + 1); \
|
||||
snprintf(text, len + errno_len + 1, __VA_ARGS__); \
|
||||
snprintf(&text[len], errno_len + 1, ": %s", strerror(_errno)); \
|
||||
snprintf(&text[len], errno_len + 1, ": %s", strerror(errno_copy)); \
|
||||
struct user_notification notif = { \
|
||||
.kind = USER_NOTIFICATION_ERROR, \
|
||||
.text = text, \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue