[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:
Pete Delaney
2013-02-25 22:52:02 -08:00
parent e36716a74c
commit 7ddc46bf9f

View File

@@ -70,6 +70,17 @@ static inline char *portable_tag() {
#define LOG_TAG PORTABLE_TAG
#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>
# define PERROR(str) { \