projects
/
profile
/
ivi
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4983ba6
)
Initialize struct stat in error case correctly
author
Daniel Wagner
<daniel.wagner@bmw-carit.de>
Mon, 11 Oct 2010 09:17:03 +0000
(11:17 +0200)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Mon, 11 Oct 2010 09:31:33 +0000
(11:31 +0200)
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
patch
|
blob
|
history
diff --git
a/src/stats.c
b/src/stats.c
index
b290c13
..
f646bac
100644
(file)
--- 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;
}