/**
* collectd - src/netcmd.c
- * Copyright (C) 2007-2012 Florian octo Forster
+ * Copyright (C) 2007-2013 Florian octo Forster
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
static struct pollfd *pollfd = NULL;
static size_t pollfd_num;
-static int listen_thread_loop = 0;
-static int listen_thread_running = 0;
+static _Bool listen_thread_loop = 0;
+static _Bool listen_thread_running = 0;
static pthread_t listen_thread;
/*
pthread_exit ((void *) -1);
}
- while (listen_thread_loop != 0)
+ while (listen_thread_loop)
{
status = poll (pollfd, (nfds_t) pollfd_num, /* timeout = */ -1);
if (status < 0)
pthread_attr_init (&th_attr);
pthread_attr_setdetachstate (&th_attr, PTHREAD_CREATE_DETACHED);
- status = pthread_create (&th, &th_attr, nc_handle_client,
- conn);
+ status = pthread_create (&th, &th_attr, nc_handle_client, conn);
+ pthread_attr_destroy (&th_attr);
if (status != 0)
{
WARNING ("netcmd plugin: pthread_create failed: %s",