Browse code

- openbsd fixes from Hendrik Scholz <hscholz@raisdorf.net>: - sigwaitinfo is not available on openbsd => s/sigwaitinfo/sigwait/ - sigwait requires linking with libpthread (on openbsd) - openbsd requires netinet/in_systm.h

Andrei Pelinescu-Onciul authored on 10/02/2006 21:01:23
Showing 2 changed files
... ...
@@ -61,7 +61,7 @@ MAIN_NAME=ser
61 61
 VERSION = 0
62 62
 PATCHLEVEL = 10
63 63
 SUBLEVEL =   99
64
-EXTRAVERSION = -dev32
64
+EXTRAVERSION = -dev33
65 65
 
66 66
 SER_VER = $(shell expr $(VERSION) \* 1000000 + $(PATCHLEVEL) \* 1000 + \
67 67
 			$(SUBLEVEL) )
... ...
@@ -1094,7 +1094,8 @@ endif
1094 1094
 ifeq ($(OS), openbsd)
1095 1095
 	DEFS+=-DHAVE_SOCKADDR_SA_LEN  -DHAVE_GETHOSTBYNAME2 \
1096 1096
 		-DHAVE_UNION_SEMUN -DHAVE_MSGHDR_MSG_CONTROL \
1097
-		-DHAVE_CONNECT_ECONNRESET_BUG -DHAVE_TIMEGM
1097
+		-DHAVE_CONNECT_ECONNRESET_BUG -DHAVE_TIMEGM \
1098
+		-DHAVE_NETINET_IN_SYSTM -DUSE_SIGWAIT
1098 1099
 	ifneq ($(found_lock_method), yes)
1099 1100
 		DEFS+= -DUSE_PTHREAD_MUTEX  # try pthread sems
1100 1101
 		found_lock_method=yes
... ...
@@ -1111,7 +1112,8 @@ ifeq ($(OS), openbsd)
1111 1111
 	# (symbols on openbsd are prefixed by "_")
1112 1112
 	YACC=yacc
1113 1113
 	# no sched_yield on openbsd unless linking with c_r (not recommended)
1114
-	LIBS= -lfl 
1114
+	# unfortunately pthread is needed for sigwait
1115
+	LIBS= -lfl -lpthread
1115 1116
 	OPENBSD_IS_AOUT= $(shell echo "$(OSREL)" | \
1116 1117
 				sed -e 's/^3\.[0-3][^0-9]*$$/yes/' |sed -e 's/^[0-2]\..*/yes/')
1117 1118
 # exception: on sparc openbsd 3.2 is elf and not aout
... ...
@@ -987,7 +987,11 @@ void slow_timer_main()
987 987
 	
988 988
 	in_slow_timer=1; /* mark this process as the slow timer */
989 989
 	while(1){
990
+#ifdef USE_SIGWAIT
991
+		n=sigwait(&slow_timer_sset, 0);
992
+#else
990 993
 		n=sigwaitinfo(&slow_timer_sset, 0);
994
+#endif
991 995
 		if (n==-1){
992 996
 			if (errno==EINTR) continue; /* some other signal, ignore it */
993 997
 			LOG(L_ERR, "ERROR: slow_timer_main: sigwaitinfo failed: %s [%d]\n",