Permalink
Browse files

Fixes for FreeBSD 9 build.

  • Loading branch information...
1 parent 5713baf commit e42f311edff17632cec74e18122d91ac2508898a Jamie Turner committed Feb 29, 2012
Showing with 7 additions and 3 deletions.
  1. +2 −2 Makefile
  2. +5 −1 stud.c
View
@@ -7,8 +7,8 @@ PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/share/man
-CFLAGS = -O2 -g -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE
-LDFLAGS = -lssl -lcrypto -lev
+CFLAGS = -O2 -g -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE -I/usr/local/include
+LDFLAGS = -lssl -lcrypto -lev -L/usr/local/lib
OBJS = stud.o ringbuffer.o configuration.o
all: realall
View
6 stud.c
@@ -72,7 +72,9 @@
/* For Mac OS X */
#ifndef TCP_KEEPIDLE
-# define TCP_KEEPIDLE TCP_KEEPALIVE
+# ifdef TCP_KEEPALIVE
+# define TCP_KEEPIDLE TCP_KEEPALIVE
+# endif
#endif
#ifndef SOL_TCP
# define SOL_TCP IPPROTO_TCP
@@ -177,9 +179,11 @@ static void settcpkeepalive(int fd) {
optval = CONFIG->TCP_KEEPALIVE_TIME;
optlen = sizeof(optval);
+#ifdef TCP_KEEPIDLE
if(setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, &optval, optlen) < 0) {
ERR("Error setting TCP_KEEPIDLE on client socket: %s", strerror(errno));
}
+#endif
}
static void fail(const char* s) {

0 comments on commit e42f311

Please sign in to comment.