*/
#include "collectd.h"
+
#include "plugin.h"
#include "common.h"
-#include "configfile.h"
#define NAGIOS_OK 0
#define NAGIOS_WARNING 1
static int nagios_config (oconfig_item_t *ci) /* {{{ */
{
- int i;
-
- for (i = 0; i < ci->children_num; i++)
+ for (int i = 0; i < ci->children_num; i++)
{
oconfig_item_t *child = ci->children + i;
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;
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)