projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #1856 from rubenk/snmp-dont-dispatch-values-with-empty-type-instance
[collectd.git]
/
src
/
utils_fbhash.c
diff --git
a/src/utils_fbhash.c
b/src/utils_fbhash.c
index
d1a580c
..
893bfbd
100644
(file)
--- a/
src/utils_fbhash.c
+++ b/
src/utils_fbhash.c
@@
-25,6
+25,7
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
+
#include "plugin.h"
#include "utils_fbhash.h"
#include "plugin.h"
#include "utils_fbhash.h"
@@
-69,7
+70,7
@@
static int fbh_read_file (fbhash_t *h) /* {{{ */
{
FILE *fh;
char buffer[4096];
{
FILE *fh;
char buffer[4096];
- struct flock fl;
+ struct flock fl
= { 0 }
;
c_avl_tree_t *tree;
int status;
c_avl_tree_t *tree;
int status;
@@
-77,11
+78,8
@@
static int fbh_read_file (fbhash_t *h) /* {{{ */
if (fh == NULL)
return (-1);
if (fh == NULL)
return (-1);
- memset (&fl, 0, sizeof (fl));
fl.l_type = F_RDLCK;
fl.l_whence = SEEK_SET;
fl.l_type = F_RDLCK;
fl.l_whence = SEEK_SET;
- fl.l_start = 0;
- fl.l_len = 0; /* == entire file */
/* TODO: Lock file? -> fcntl */
status = fcntl (fileno (fh), F_SETLK, &fl);
/* TODO: Lock file? -> fcntl */
status = fcntl (fileno (fh), F_SETLK, &fl);
@@
-177,11
+175,9
@@
static int fbh_read_file (fbhash_t *h) /* {{{ */
static int fbh_check_file (fbhash_t *h) /* {{{ */
{
static int fbh_check_file (fbhash_t *h) /* {{{ */
{
- struct stat statbuf;
+ struct stat statbuf
= { 0 }
;
int status;
int status;
- memset (&statbuf, 0, sizeof (statbuf));
-
status = stat (h->filename, &statbuf);
if (status != 0)
return (-1);
status = stat (h->filename, &statbuf);
if (status != 0)
return (-1);