/* Folks without pthread will need to disable this plugin. */
#include <pthread.h>
-#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/un.h>
return (-1);
}
- chmod (sa.sun_path, sock_perms);
+ status = chmod (sa.sun_path, sock_perms);
+ if (status == -1)
+ {
+ char errbuf[1024];
+ ERROR ("unixsock plugin: chmod failed: %s",
+ sstrerror (errno, errbuf, sizeof (errbuf)));
+ close (sock_fd);
+ sock_fd = -1;
+ return (-1);
+ }
status = listen (sock_fd, 8);
if (status != 0)
do
{
- char *grpname;
+ const char *grpname;
struct group *g;
struct group sg;
char grbuf[2048];
pthread_exit ((void *) 1);
}
- remote_fd = (int *) malloc (sizeof (int));
+ remote_fd = malloc (sizeof (*remote_fd));
if (remote_fd == NULL)
{
char errbuf[1024];