[MIPS] Allow errno safe logging
Change-Id: I35b4a9007572bec15ab7ba81aad3756fa96c5eb2 Signed-off-by: Chris Dearman <chris.dearman@imgtec.com> Signed-off-by: Pete Delaney <piet.delaney@imgtec.com>
This commit is contained in:
@@ -70,6 +70,17 @@ static inline char *portable_tag() {
|
|||||||
#define LOG_TAG PORTABLE_TAG
|
#define LOG_TAG PORTABLE_TAG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Override LOG_PRI() defined in ${AOSP}/system/core/include/cutils/log.h
|
||||||
|
* to preserve the value of errno while logging.
|
||||||
|
*/
|
||||||
|
#define LOG_PRI(priority, tag, ...) ({ \
|
||||||
|
int _errno = errno; \
|
||||||
|
int _rv = android_printLog(priority, tag, __VA_ARGS__); \
|
||||||
|
errno = _errno; \
|
||||||
|
_rv; /* Returned to caller */ \
|
||||||
|
})
|
||||||
|
|
||||||
# include <cutils/log.h>
|
# include <cutils/log.h>
|
||||||
|
|
||||||
# define PERROR(str) { \
|
# define PERROR(str) { \
|
||||||
|
|||||||
Reference in New Issue
Block a user