projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.5' into collectd-5.6
[collectd.git]
/
src
/
daemon
/
utils_tail.c
diff --git
a/src/daemon/utils_tail.c
b/src/daemon/utils_tail.c
index
fe5dca8
..
0d8ed7c
100644
(file)
--- a/
src/daemon/utils_tail.c
+++ b/
src/daemon/utils_tail.c
@@
-31,6
+31,7
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "common.h"
#include "utils_tail.h"
#include "common.h"
#include "utils_tail.h"
@@
-45,10
+46,9
@@
static int cu_tail_reopen (cu_tail_t *obj)
{
int seek_end = 0;
FILE *fh;
{
int seek_end = 0;
FILE *fh;
- struct stat stat_buf;
+ struct stat stat_buf
= { 0 }
;
int status;
int status;
- memset (&stat_buf, 0, sizeof (stat_buf));
status = stat (obj->file, &stat_buf);
if (status != 0)
{
status = stat (obj->file, &stat_buf);
if (status != 0)
{
@@
-119,10
+119,9
@@
cu_tail_t *cu_tail_create (const char *file)
{
cu_tail_t *obj;
{
cu_tail_t *obj;
- obj =
(cu_tail_t *) malloc (sizeof (cu_tail_t
));
+ obj =
calloc (1, sizeof (*obj
));
if (obj == NULL)
return (NULL);
if (obj == NULL)
return (NULL);
- memset (obj, '\0', sizeof (cu_tail_t));
obj->file = strdup (file);
if (obj->file == NULL)
obj->file = strdup (file);
if (obj->file == NULL)