Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
5d27c86a
Unverified
Commit
5d27c86a
authored
May 13, 2019
by
Rachid Koucha
Committed by
Christian Brauner
May 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use %m instead of strerror() when available
Use %m under HAVE_M_FORMAT instead of strerror() Signed-off-by:
Rachid Koucha
<
rachid.koucha@gmail.com
>
parent
7d1a06e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
log.h
src/lxc/log.h
+41
-0
No files found.
src/lxc/log.h
View file @
5d27c86a
...
@@ -416,53 +416,94 @@ ATTR_UNUSED static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
...
@@ -416,53 +416,94 @@ ATTR_UNUSED static inline void LXC_##LEVEL(struct lxc_log_locinfo* locinfo, \
LXC_FATAL(&locinfo, format, ##__VA_ARGS__); \
LXC_FATAL(&locinfo, format, ##__VA_ARGS__); \
} while (0)
} while (0)
#if HAVE_M_FORMAT
#define SYSTRACE(format, ...) \
TRACE("%m - " format, ##__VA_ARGS__);
#else
#define SYSTRACE(format, ...) \
#define SYSTRACE(format, ...) \
do { \
do { \
lxc_log_strerror_r; \
lxc_log_strerror_r; \
TRACE("%s - " format, ptr, ##__VA_ARGS__); \
TRACE("%s - " format, ptr, ##__VA_ARGS__); \
} while (0)
} while (0)
#endif
#if HAVE_M_FORMAT
#define SYSDEBUG(format, ...) \
DEBUG("%m - " format, ##__VA_ARGS__)
#else
#define SYSDEBUG(format, ...) \
#define SYSDEBUG(format, ...) \
do { \
do { \
lxc_log_strerror_r; \
lxc_log_strerror_r; \
DEBUG("%s - " format, ptr, ##__VA_ARGS__); \
DEBUG("%s - " format, ptr, ##__VA_ARGS__); \
} while (0)
} while (0)
#endif
#if HAVE_M_FORMAT
#define SYSINFO(format, ...) \
INFO("%m - " format, ##__VA_ARGS__)
#else
#define SYSINFO(format, ...) \
#define SYSINFO(format, ...) \
do { \
do { \
lxc_log_strerror_r; \
lxc_log_strerror_r; \
INFO("%s - " format, ptr, ##__VA_ARGS__); \
INFO("%s - " format, ptr, ##__VA_ARGS__); \
} while (0)
} while (0)
#endif
#if HAVE_M_FORMAT
#define SYSNOTICE(format, ...) \
NOTICE("%m - " format, ##__VA_ARGS__)
#else
#define SYSNOTICE(format, ...) \
#define SYSNOTICE(format, ...) \
do { \
do { \
lxc_log_strerror_r; \
lxc_log_strerror_r; \
NOTICE("%s - " format, ptr, ##__VA_ARGS__); \
NOTICE("%s - " format, ptr, ##__VA_ARGS__); \
} while (0)
} while (0)
#endif
#if HAVE_M_FORMAT
#define SYSWARN(format, ...) \
WARN("%m - " format, ##__VA_ARGS__)
#else
#define SYSWARN(format, ...) \
#define SYSWARN(format, ...) \
do { \
do { \
lxc_log_strerror_r; \
lxc_log_strerror_r; \
WARN("%s - " format, ptr, ##__VA_ARGS__); \
WARN("%s - " format, ptr, ##__VA_ARGS__); \
} while (0)
} while (0)
#endif
#if HAVE_M_FORMAT
#define SYSERROR(format, ...) \
ERROR("%m - " format, ##__VA_ARGS__)
#else
#define SYSERROR(format, ...) \
#define SYSERROR(format, ...) \
do { \
do { \
lxc_log_strerror_r; \
lxc_log_strerror_r; \
ERROR("%s - " format, ptr, ##__VA_ARGS__); \
ERROR("%s - " format, ptr, ##__VA_ARGS__); \
} while (0)
} while (0)
#endif
#if HAVE_M_FORMAT
#define CMD_SYSERROR(format, ...) \
fprintf(stderr, "%m - " format, ##__VA_ARGS__)
#else
#define CMD_SYSERROR(format, ...) \
#define CMD_SYSERROR(format, ...) \
do { \
do { \
lxc_log_strerror_r; \
lxc_log_strerror_r; \
fprintf(stderr, "%s - " format, ptr, ##__VA_ARGS__); \
fprintf(stderr, "%s - " format, ptr, ##__VA_ARGS__); \
} while (0)
} while (0)
#endif
#if HAVE_M_FORMAT
#define CMD_SYSINFO(format, ...) \
printf("%m - " format, ##__VA_ARGS__)
#else
#define CMD_SYSINFO(format, ...) \
#define CMD_SYSINFO(format, ...) \
do { \
do { \
lxc_log_strerror_r; \
lxc_log_strerror_r; \
printf("%s - " format, ptr, ##__VA_ARGS__); \
printf("%s - " format, ptr, ##__VA_ARGS__); \
} while (0)
} while (0)
#endif
extern
int
lxc_log_fd
;
extern
int
lxc_log_fd
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment