From: Daniel Wagner <[email protected]>

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.
---
 src/stats.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/stats.c b/src/stats.c
index b290c13..f646bac 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;
        }
 
-- 
1.7.2.3

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to