summaryrefslogtreecommitdiff
path: root/ipanat
diff options
context:
space:
mode:
authorSkylar Chang <chiaweic@codeaurora.org>2014-06-26 05:22:02 -0700
committerSkylar Chang <chiaweic@codeaurora.org>2014-06-26 05:24:50 -0700
commit96deecd2546cae81e71bb66ec18e778f2549a714 (patch)
treed9b6529584ab4803de7d0d1ac858bebbd51ce655 /ipanat
parent62ce01933dc261c07ad3e83a38ab73ca5500ab66 (diff)
downloadipacfg-mgr-96deecd2546cae81e71bb66ec18e778f2549a714.tar.gz
IPANAT: remove the syslog usage
Recently we found in android platform, the syslog will open lots of sockets and not close them correctly. Eventually it will exceed the max file descriptor each process could open, then leading crash. The cahnge is to avoid using syslog to log message. Change-Id: Ib7e2a669d1f0f56528d00e2cef9b10e51e04b4b0
Diffstat (limited to 'ipanat')
-rw-r--r--ipanat/inc/ipa_nat_logi.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/ipanat/inc/ipa_nat_logi.h b/ipanat/inc/ipa_nat_logi.h
index 0e1a5d1..5f79cc6 100644
--- a/ipanat/inc/ipa_nat_logi.h
+++ b/ipanat/inc/ipa_nat_logi.h
@@ -50,18 +50,15 @@ extern "C"
#include <string.h>
#include <syslog.h>
-#define PERROR(fmt) printf("%s:%d %s()", __FILE__, __LINE__, __FUNCTION__);\
- perror(fmt);
+#define PERROR(fmt) printf("%s:%d %s()", __FILE__, __LINE__, __FUNCTION__);\
+ perror(fmt);
-#define IPAERR(fmt, ...) syslog(LOG_ERR, "ERROR: %s:%d %s() " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);\
- printf("ERR: %s:%d %s() " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);
+#define IPAERR(fmt, ...) printf("ERR: %s:%d %s() " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);
#ifdef DEBUG
-#define IPADBG(fmt, ...) syslog(LOG_DEBUG, "%s:%d %s() " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);\
- printf("%s:%d %s() " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);
+#define IPADBG(fmt, ...) printf("%s:%d %s() " fmt, __FILE__, __LINE__, __FUNCTION__, ##__VA_ARGS__);
-#define IPADUMP(fmt, ...) syslog(LOG_DEBUG, fmt, ##__VA_ARGS__);\
- printf(fmt, ##__VA_ARGS__);
+#define IPADUMP(fmt, ...) printf(fmt, ##__VA_ARGS__);
#else
#define IPADBG(fmt, ...)