X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fnotify_nagios.c;h=c53294b2ba47a1c3579bbe39b665c66c75799328;hb=f35f67df9ccfb80c001ed0befcce8bb90ebb2a07;hp=1f4182bbf8efee2cdd125a7d9f742d8e6289eda3;hpb=50345eec33951b964e2829e83c30399b71f2baba;p=collectd.git diff --git a/src/notify_nagios.c b/src/notify_nagios.c index 1f4182bb..c53294b2 100644 --- a/src/notify_nagios.c +++ b/src/notify_nagios.c @@ -25,6 +25,7 @@ */ #include "collectd.h" + #include "plugin.h" #include "common.h" #include "configfile.h" @@ -63,7 +64,7 @@ static int nagios_print (char const *buffer) /* {{{ */ char const *file = NAGIOS_COMMAND_FILE; int fd; int status; - struct flock lock; + struct flock lock = { 0 }; if (nagios_command_file != NULL) file = nagios_command_file; @@ -78,11 +79,8 @@ static int nagios_print (char const *buffer) /* {{{ */ return status; } - memset (&lock, 0, sizeof (lock)); lock.l_type = F_WRLCK; lock.l_whence = SEEK_END; - lock.l_start = 0; - lock.l_len = 0; /* to end of file */ status = fcntl (fd, F_GETLK, &lock); if (status != 0)