summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkibak.yoon <kibak.yoon@samsung.com>2016-04-01 22:24:16 +0900
committerkibak.yoon <kibak.yoon@samsung.com>2016-04-01 22:24:16 +0900
commit69561143fc0e6e5c0c2db32f4a9fddfcd7069d62 (patch)
tree94aa7468e2fee4ad384465b0007d6c2dd3ced332
parent7e41ddce791c2b750e9b7b12fc100d3e94a01af2 (diff)
downloadsensor-tm1-69561143fc0e6e5c0c2db32f4a9fddfcd7069d62.tar.gz
sensor-tm1-69561143fc0e6e5c0c2db32f4a9fddfcd7069d62.tar.bz2
sensor-tm1-69561143fc0e6e5c0c2db32f4a9fddfcd7069d62.zip
Revert "sensor-hal: change strerror to strerror_r"
This reverts commit 61747df734a8ecbc294f6fbf4df00efb71fc8551.
-rw-r--r--src/accel/accel.cpp2
-rw-r--r--src/create.cpp4
-rw-r--r--src/proxi/proxi.cpp4
-rw-r--r--src/sensor_logs.h10
4 files changed, 5 insertions, 15 deletions
diff --git a/src/accel/accel.cpp b/src/accel/accel.cpp
index cc856b4..6466c24 100644
--- a/src/accel/accel.cpp
+++ b/src/accel/accel.cpp
@@ -91,7 +91,7 @@ accel_device::accel_device()
m_interval_node = info.interval_node_path;
if ((m_node_handle = open(m_data_node.c_str(), O_RDWR)) < 0) {
- _ERRNO(errno, _E, "accel handle open fail for accel processor");
+ ERR("accel handle open fail for accel processor, error:%s\n", strerror(errno));
throw ENXIO;
}
diff --git a/src/create.cpp b/src/create.cpp
index 33f54fc..0b6e2cd 100644
--- a/src/create.cpp
+++ b/src/create.cpp
@@ -32,10 +32,10 @@ void create_sensor(const char *name)
try {
instance = new _sensor;
} catch (std::exception &e) {
- ERR("Failed to create %s sensor device (%s)", name, e.what());
+ ERR("Failed to create %s sensor device, exception: %s", name, e.what());
return;
} catch (int err) {
- _ERRNO(err, _E, "Failed to create %s sensor device", name);
+ ERR("Failed to create %s sensor device, err: %d, cause: %s", name, err, strerror(err));
return;
}
diff --git a/src/proxi/proxi.cpp b/src/proxi/proxi.cpp
index 819a5b6..e029cdb 100644
--- a/src/proxi/proxi.cpp
+++ b/src/proxi/proxi.cpp
@@ -82,7 +82,7 @@ proxi_device::proxi_device()
m_enable_node = info.enable_node_path;
if ((m_node_handle = open(m_data_node.c_str(), O_RDWR)) < 0) {
- _ERRNO(errno, _E, "proxi handle open fail for proxi device");
+ ERR("accel handle open fail for accel processor, error:%s", strerror(errno));
throw ENXIO;
}
@@ -154,7 +154,7 @@ bool proxi_device::update_value_input_event(void)
int len = read(m_node_handle, &proxi_event, sizeof(proxi_event));
if (len == -1) {
- _ERRNO(errno, _D, "Failed to read from m_node_handle[%d]", m_node_handle);
+ DBG("read(m_node_handle) is error:%s", strerror(errno));
return false;
}
diff --git a/src/sensor_logs.h b/src/sensor_logs.h
index 395abb1..3385aad 100644
--- a/src/sensor_logs.h
+++ b/src/sensor_logs.h
@@ -61,16 +61,6 @@ enum sf_priority_type {
#define _I INFO
#define _D DBG
-#define _ERRNO(errno, tag, fmt, arg...) do { \
- char buf[1024]; \
- char *error = strerror_r(errno, buf, 1024); \
- if (!error) { \
- _E("Failed to strerror_r()"); \
- break; \
- } \
- tag(fmt" (%s[%d])", ##arg, error, errno); \
- } while (0)
-
#if defined(_DEBUG)
# define warn_if(expr, fmt, arg...) do { \
if(expr) { \