socket: fix proto not supported under FreeBSD (FS#349)
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
9ce1f986d9
commit
d7e5a8f1a3
|
@ -92,7 +92,11 @@ sockets_reconnect(void)
|
|||
static int
|
||||
send_msg(const char *msg, ssize_t msg_len)
|
||||
{
|
||||
#ifndef __FreeBSD__
|
||||
if(send(csfd, msg, msg_len, MSG_NOSIGNAL | MSG_EOR) == -1)
|
||||
#else
|
||||
if(send(csfd, msg, msg_len, MSG_NOSIGNAL | MSG_EOF) == -1)
|
||||
#endif
|
||||
{
|
||||
switch (errno)
|
||||
{
|
||||
|
|
|
@ -78,8 +78,11 @@ int
|
|||
socket_getclient(void)
|
||||
{
|
||||
int csfd;
|
||||
|
||||
#ifndef __FreeBSD__
|
||||
csfd = socket(AF_UNIX, SOCK_SEQPACKET, 0);
|
||||
#else
|
||||
csfd = socket(PF_UNIX, SOCK_STREAM, 0);
|
||||
#endif
|
||||
|
||||
if(csfd < 0)
|
||||
warn("error opening UNIX domain socket: %s", strerror(errno));
|
||||
|
|
Loading…
Reference in New Issue