We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 62eb6d3 + 7ddc46b commit 27bd326Copy full SHA for 27bd326
ndk/sources/android/libportable/common/include/log_portable.h
@@ -70,6 +70,17 @@ static inline char *portable_tag() {
70
#define LOG_TAG PORTABLE_TAG
71
#endif
72
73
+/*
74
+ * Override LOG_PRI() defined in ${AOSP}/system/core/include/cutils/log.h
75
+ * to preserve the value of errno while logging.
76
+ */
77
+#define LOG_PRI(priority, tag, ...) ({ \
78
+ int _errno = errno; \
79
+ int _rv = android_printLog(priority, tag, __VA_ARGS__); \
80
+ errno = _errno; \
81
+ _rv; /* Returned to caller */ \
82
+})
83
+
84
# include <cutils/log.h>
85
86
# define PERROR(str) { \
0 commit comments