projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
grpc plugin: Create a "Dispatch" service and use streaming RPCs.
[collectd.git]
/
src
/
utils_fbhash.c
diff --git
a/src/utils_fbhash.c
b/src/utils_fbhash.c
index
d1a580c
..
d980f58
100644
(file)
--- a/
src/utils_fbhash.c
+++ b/
src/utils_fbhash.c
@@
-69,7
+69,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
+77,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
+174,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);