mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-03-13 11:03:43 +00:00
fixed usage of strerror_r()
This commit is contained in:
@@ -83,9 +83,9 @@ pthread_mutex_t log_mutex;
|
|||||||
|
|
||||||
#define LOG_PERROR(_msg, ...) { \
|
#define LOG_PERROR(_msg, ...) { \
|
||||||
char _buf[1024] = ""; \
|
char _buf[1024] = ""; \
|
||||||
strerror_r(errno, _buf, 1024); \
|
char *_ptr = strerror_r(errno, _buf, 1024); \
|
||||||
LOGGING_LOCK; \
|
LOGGING_LOCK; \
|
||||||
printf("-- ERROR [%.03Lf tid=%ld] -- " _msg ": %s\n", get_now_monotonic(), syscall(SYS_gettid), ##__VA_ARGS__, _buf); \
|
printf("-- ERROR [%.03Lf tid=%ld] -- " _msg ": %s\n", get_now_monotonic(), syscall(SYS_gettid), ##__VA_ARGS__, _ptr); \
|
||||||
fflush(stdout); \
|
fflush(stdout); \
|
||||||
LOGGING_UNLOCK; \
|
LOGGING_UNLOCK; \
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user