From da274e1b08f8189d4b1f4c0e6399500529d6ac24 Mon Sep 17 00:00:00 2001 From: "kj7.sung" Date: Wed, 27 Apr 2016 16:05:08 +0900 Subject: [PATCH] Change batch path Change-Id: Ie3d7957950fa0455d3d4429c32deb908dbd451f3 Signed-off-by: kj7.sung --- location/manager/location-batch.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/location/manager/location-batch.c b/location/manager/location-batch.c index 7e1cbb0..5c8cf90 100755 --- a/location/manager/location-batch.c +++ b/location/manager/location-batch.c @@ -103,8 +103,9 @@ location_get_batch_file(int num_of_location) LocationBatch *batch = location_batch_new(num_of_location); batch->num_of_location = num_of_location; - const char *batch_path = tzplatform_mkpath(TZ_USER_CONTENT, "lbs-server/location_batch.log"); + const char *batch_path = tzplatform_mkpath(TZ_SYS_MEDIA, "lbs-server/location_batch.log"); FILE *fd = fopen(batch_path, "r"); + if (fd != NULL) { char buf[BATCH_SENTENCE_SIZE] = { 0, }; int i = 0; @@ -112,10 +113,17 @@ location_get_batch_file(int num_of_location) for (i = 0; i < num_of_location; i++) { if (fgets(buf, BATCH_SENTENCE_SIZE, fd) != NULL) location_set_batch_parse_details(batch, buf, i); + else + LOCATION_LOGE("Batch fgets failed"); + } + + if (fd != 0) { + if (fclose(fd) != 0) + LOCATION_LOGE("Batch fclose failed"); + fd = NULL; } - fclose(fd); } else { - LOCATION_LOGE("Batch fd is NULL"); + LOCATION_LOGE("Batch fopen failed. fd is NULL"); } return batch; } -- 2.7.4