Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.

Commit e42f311

Browse files
author
Jamie Turner
committed
Fixes for FreeBSD 9 build.
1 parent 5713baf commit e42f311

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Diff for: Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ PREFIX = /usr/local
77
BINDIR = $(PREFIX)/bin
88
MANDIR = $(PREFIX)/share/man
99

10-
CFLAGS = -O2 -g -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE
11-
LDFLAGS = -lssl -lcrypto -lev
10+
CFLAGS = -O2 -g -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE -I/usr/local/include
11+
LDFLAGS = -lssl -lcrypto -lev -L/usr/local/lib
1212
OBJS = stud.o ringbuffer.o configuration.o
1313

1414
all: realall

Diff for: stud.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@
7272

7373
/* For Mac OS X */
7474
#ifndef TCP_KEEPIDLE
75-
# define TCP_KEEPIDLE TCP_KEEPALIVE
75+
# ifdef TCP_KEEPALIVE
76+
# define TCP_KEEPIDLE TCP_KEEPALIVE
77+
# endif
7678
#endif
7779
#ifndef SOL_TCP
7880
# define SOL_TCP IPPROTO_TCP
@@ -177,9 +179,11 @@ static void settcpkeepalive(int fd) {
177179

178180
optval = CONFIG->TCP_KEEPALIVE_TIME;
179181
optlen = sizeof(optval);
182+
#ifdef TCP_KEEPIDLE
180183
if(setsockopt(fd, SOL_TCP, TCP_KEEPIDLE, &optval, optlen) < 0) {
181184
ERR("Error setting TCP_KEEPIDLE on client socket: %s", strerror(errno));
182185
}
186+
#endif
183187
}
184188

185189
static void fail(const char* s) {

0 commit comments

Comments
 (0)