From d7e5a8f1a36a3d86cb3a628bcaf1022545e1d60e Mon Sep 17 00:00:00 2001 From: Konstantin Stepanov Date: Mon, 3 Nov 2008 14:53:23 +0100 Subject: [PATCH] socket: fix proto not supported under FreeBSD (FS#349) Signed-off-by: Julien Danjou --- awesome-client.c | 4 ++++ common/socket.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/awesome-client.c b/awesome-client.c index 6e552efa..a70f4f06 100644 --- a/awesome-client.c +++ b/awesome-client.c @@ -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) { diff --git a/common/socket.c b/common/socket.c index 840029cc..ba89831c 100644 --- a/common/socket.c +++ b/common/socket.c @@ -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));