#include "plugin.h"
#include "utils_cache.h"
-#include <pthread.h>
-
#ifdef HAVE_MATH_H
# include <math.h>
#endif
ptr = (const char *) buf;
nleft = count;
+ if (fd < 0)
+ return (-1);
+
/* checking for closed peer connection */
pfd.fd = fd;
pfd.events = POLLIN | POLLHUP;