socket: fix proto not supported under FreeBSD (FS#349)

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Konstantin Stepanov 2008-11-03 14:53:23 +01:00 committed by Julien Danjou
parent 9ce1f986d9
commit d7e5a8f1a3
2 changed files with 8 additions and 1 deletions

View File

@ -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)
{

View File

@ -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));