Change batch path 26/67526/1 accepted/tizen/common/20160427.144152 accepted/tizen/ivi/20160428.002512 accepted/tizen/mobile/20160428.004629 accepted/tizen/tv/20160428.002341 accepted/tizen/wearable/20160428.002600 submit/tizen/20160427.074536
authorkj7.sung <kj7.sung@samsung.com>
Wed, 27 Apr 2016 07:05:08 +0000 (16:05 +0900)
committerkj7.sung <kj7.sung@samsung.com>
Wed, 27 Apr 2016 07:05:08 +0000 (16:05 +0900)
Change-Id: Ie3d7957950fa0455d3d4429c32deb908dbd451f3
Signed-off-by: kj7.sung <kj7.sung@samsung.com>
location/manager/location-batch.c

index 7e1cbb0..5c8cf90 100755 (executable)
@@ -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;
 }