summaryrefslogtreecommitdiff
path: root/src/bluetooth-otp.c
diff options
context:
space:
mode:
authorAnupam Roy <anupam.r@samsung.com>2017-09-11 18:08:20 +0530
committerAnupam Roy <anupam.r@samsung.com>2017-09-12 15:44:58 +0530
commite568652a07308c6ad29627a6aa22fdae41559548 (patch)
treec99d0b7c60c1fd667c58543660c23f89e412a5fc /src/bluetooth-otp.c
parent22c2a1e3b7c28d40d26da1cfc576400444979852 (diff)
downloadbluetooth-e568652a07308c6ad29627a6aa22fdae41559548.tar.gz
bluetooth-e568652a07308c6ad29627a6aa22fdae41559548.tar.bz2
bluetooth-e568652a07308c6ad29627a6aa22fdae41559548.zip
SVACE Fixes
ID's: 252909, 258247, 258248, 258249 Change-Id: I2047d86323c95d58610a71446b727f8375d0147b Signed-off-by: Anupam Roy <anupam.r@samsung.com>
Diffstat (limited to 'src/bluetooth-otp.c')
-rw-r--r--src/bluetooth-otp.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/bluetooth-otp.c b/src/bluetooth-otp.c
index 8f1f30d..7a5328a 100644
--- a/src/bluetooth-otp.c
+++ b/src/bluetooth-otp.c
@@ -1838,6 +1838,7 @@ static gboolean __client_data_received_cb(GIOChannel *chan, GIOCondition cond,
object_metadata *object_info = NULL;
uint64_t obj_id;
FILE *fp = NULL;
+ char err_msg[256] = {0, };
otp_client_s = _bt_otp_client_find(remote_addr);
if (otp_client_s == NULL) {
@@ -1859,7 +1860,8 @@ static gboolean __client_data_received_cb(GIOChannel *chan, GIOCondition cond,
fp = fopen(file_path, "w");
if (!fp) {
- BT_DBG("fopen() failed : %s", strerror(errno));
+ strerror_r(errno, err_msg, sizeof(err_msg));
+ BT_ERR("fopen() failed : %s", err_msg);
goto fail;
}
@@ -1911,6 +1913,7 @@ static void _bt_otp_client_write_on_fd(bluetooth_otc_info_t *otc_info)
bluetooth_device_address_t addr_hex = { {0,} };
struct tm fc_tm;
uint8_t value[7];
+ char err_msg[256] = {0, };
if (!oacp_write_op) {
result = BLUETOOTH_ERROR_INTERNAL;
@@ -1921,7 +1924,8 @@ static void _bt_otp_client_write_on_fd(bluetooth_otc_info_t *otc_info)
fp = fopen(oacp_write_op->file_path, "r");
if (!fp) {
- BT_DBG("fopen() failed : %s", strerror(errno));
+ strerror_r(errno, err_msg, sizeof(err_msg));
+ BT_ERR("fopen() failed : %s", err_msg);
result = BLUETOOTH_ERROR_INTERNAL;
goto fail;
}
@@ -2232,6 +2236,7 @@ int bt_otp_client_create_object(bt_otp_client_h otp_client,
char *file_name, *last_token;
time_t curr_time;
char *type_uuid;
+ char err_msg[256] = {0, };
BT_CHECK_LE_SUPPORT();
BT_CHECK_INIT_STATUS();
@@ -2260,7 +2265,8 @@ int bt_otp_client_create_object(bt_otp_client_h otp_client,
/* Get file_name & size from file_path */
if (stat(file_path, &st) == -1) {
- BT_INFO("stat failed: %s (%d)\n", strerror(errno), errno);
+ strerror_r(errno, err_msg, sizeof(err_msg));
+ BT_INFO("stat failed: %s (%d)\n", err_msg, errno);
return BLUETOOTH_ERROR_INTERNAL;
}
@@ -2335,6 +2341,7 @@ int bt_otp_client_write_object(bt_otp_client_h otp_client,
struct stat st;
uint32_t size;
time_t curr_time;
+ char err_msg[256] = {0, };
BT_CHECK_LE_SUPPORT();
BT_CHECK_INIT_STATUS();
@@ -2376,7 +2383,8 @@ int bt_otp_client_write_object(bt_otp_client_h otp_client,
/* Get file_name & size from file_path */
if (stat(file_path, &st) == -1) {
- BT_INFO("stat failed: %s (%d)\n", strerror(errno), errno);
+ strerror_r(errno, err_msg, sizeof(err_msg));
+ BT_INFO("stat failed: %s (%d)\n", err_msg, errno);
return BLUETOOTH_ERROR_INTERNAL;
}