summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilind Ramesh Murhekar <m.murhekar@samsung.com>2017-10-16 13:22:03 +0530
committerMilind Ramesh Murhekar <m.murhekar@samsung.com>2017-10-16 13:22:03 +0530
commita711ff292b5f32788175bf64656f6a6d14c5f372 (patch)
tree2878b391a4e2377eb0090841a74406372ac9739f
parentc98809b6f493853b5f1994c144b2608ec269ef87 (diff)
downloadconnman-a711ff292b5f32788175bf64656f6a6d14c5f372.tar.gz
connman-a711ff292b5f32788175bf64656f6a6d14c5f372.tar.bz2
connman-a711ff292b5f32788175bf64656f6a6d14c5f372.zip
Fix SVACE issue for CID:24236, 31182
Description: This patch fixes the SVACE issue for remove() function. Change-Id: Ie9fedadb8e36d91f9a197635eb4cee6a89ad7f7b Signed-off-by: Milind Ramesh Murhekar <m.murhekar@samsung.com>
-rwxr-xr-xsrc/log.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/log.c b/src/log.c
index 32b35bc8..0a408874 100755
--- a/src/log.c
+++ b/src/log.c
@@ -77,13 +77,15 @@ static void __connman_log_update_file_revision(int rev)
next_log_file = g_strdup_printf("%s.%d", LOG_FILE_PATH, next_log_rev);
if (next_log_rev >= MAX_LOG_COUNT)
- remove(next_log_file);
+ if (remove(next_log_file) != 0)
+ __connman_log_s(LOG_INFO, "error: remove failed for %s", next_log_file);
if (access(next_log_file, F_OK) == 0)
__connman_log_update_file_revision(next_log_rev);
if (rename(log_file, next_log_file) != 0)
- remove(log_file);
+ if (remove(log_file) != 0)
+ __connman_log_s(LOG_INFO, "error: remove failed for %s", log_file);
g_free(log_file);
g_free(next_log_file);
@@ -100,7 +102,8 @@ static void __connman_log_make_backup(void)
__connman_log_update_file_revision(rev);
if (rename(LOG_FILE_PATH, backup) != 0)
- remove(LOG_FILE_PATH);
+ if (remove(LOG_FILE_PATH) != 0)
+ __connman_log_s(LOG_INFO, "error: remove failed for %s", LOG_FILE_PATH);
g_free(backup);
}