summaryrefslogtreecommitdiff
path: root/src/stats.c
diff options
context:
space:
mode:
authorDaniel Wagner <daniel.wagner@bmw-carit.de>2010-10-11 11:17:03 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2010-10-11 11:31:33 +0200
commit8661f92deddc16c69b5e9f4fcebf98e66f64f771 (patch)
treee7f2877770033aed71a58ba8e088faaee4794166 /src/stats.c
parent4983ba6923a34ed7b48f1f5a5bd150249991242b (diff)
downloadconnman-8661f92deddc16c69b5e9f4fcebf98e66f64f771.tar.gz
connman-8661f92deddc16c69b5e9f4fcebf98e66f64f771.tar.bz2
connman-8661f92deddc16c69b5e9f4fcebf98e66f64f771.zip
Initialize struct stat in error case correctly
In the case stat failes to gather information about the log file, it has to initialize struct stat. Otherwise, we will set a random file size.
Diffstat (limited to 'src/stats.c')
-rw-r--r--src/stats.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/stats.c b/src/stats.c
index b290c131..f646bac9 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -270,6 +270,7 @@ static int stats_open_file(struct connman_service *service,
err = stat(file->name, &st);
if (err < 0) {
/* according documentation the only possible error is ENOENT */
+ st.st_size = 0;
new_file = TRUE;
}