Browse Source

- auth_radius: alloca()/alloca.h fixes
- 64 bit warnings fixed
- daemonize _XOPEN_SOURCE_EXTENDED hack modified again

Andrei Pelinescu-Onciul 21 years ago
parent
commit
8d0543b999
2 changed files with 14 additions and 9 deletions
  1. 4 2
      Makefile.defs
  2. 10 7
      daemonize.c

+ 4 - 2
Makefile.defs

@@ -35,6 +35,7 @@
 #  2004-09-12  mips2 & cobalt support introduced (andrei)
 #  2004-09-12  mips2 & cobalt support introduced (andrei)
 #  2004-09-28  x86_64 support introduced (andrei)
 #  2004-09-28  x86_64 support introduced (andrei)
 #  2004-12-14  gcc-3.4 special case added (andrei)
 #  2004-12-14  gcc-3.4 special case added (andrei)
+#  2004-12-15  HAVE_ALLOCA_H added (andrei)
 
 
 
 
 # check if already included/exported
 # check if already included/exported
@@ -787,7 +788,7 @@ LIBS= -lfl -ldl -lresolv
 #os specific stuff
 #os specific stuff
 ifeq ($(OS), linux)
 ifeq ($(OS), linux)
 	DEFS+=-DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD \
 	DEFS+=-DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN -DHAVE_SCHED_YIELD \
-			-DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL
+			-DHAVE_MSG_NOSIGNAL -DHAVE_MSGHDR_MSG_CONTROL -DHAVE_ALLOCA_H
 	ifneq ($(found_lock_method), yes)
 	ifneq ($(found_lock_method), yes)
 		DEFS+= -DUSE_SYSV_SEM  # try posix sems
 		DEFS+= -DUSE_SYSV_SEM  # try posix sems
 		found_lock_method=yes
 		found_lock_method=yes
@@ -795,7 +796,8 @@ ifeq ($(OS), linux)
 endif
 endif
 
 
 ifeq  ($(OS), solaris)
 ifeq  ($(OS), solaris)
-	DEFS+= -DHAVE_GETIPNODEBYNAME -DHAVE_SYS_SOCKIO_H -DHAVE_SCHED_YIELD
+	DEFS+= -DHAVE_GETIPNODEBYNAME -DHAVE_SYS_SOCKIO_H -DHAVE_SCHED_YIELD \
+			-DHAVE_ALLOCA_H
 	ifneq ($(found_lock_method), yes)
 	ifneq ($(found_lock_method), yes)
 		DEFS+= -DUSE_PTHREAD_MUTEX  # try pthread sems
 		DEFS+= -DUSE_PTHREAD_MUTEX  # try pthread sems
 		found_lock_method=yes
 		found_lock_method=yes

+ 10 - 7
daemonize.c

@@ -36,6 +36,16 @@
 
 
 
 
 #include <sys/types.h>
 #include <sys/types.h>
+
+#define _XOPEN_SOURCE   /* needed on linux for the  getpgid prototype,  but
+                           openbsd 3.2 won't include common types (uint a.s.o)
+                           if defined before including sys/types.h */
+#define _XOPEN_SOURCE_EXTENDED /* same as above */
+#define __USE_XOPEN_EXTENDED /* same as above, overrides features.h */
+#define __EXTENSIONS__ /* needed on solaris: if XOPEN_SOURCE is defined
+                          struct timeval defintion from <sys/time.h> won't
+                          be included => workarround define _EXTENSIONS_
+                           -andrei */
 #include <signal.h>
 #include <signal.h>
 #include <syslog.h>
 #include <syslog.h>
 #include <errno.h>
 #include <errno.h>
@@ -43,13 +53,6 @@
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>
 #include <sys/resource.h> /* setrlimit */
 #include <sys/resource.h> /* setrlimit */
-
-#define _XOPEN_SOURCE   /* needed on linux for the  getpgid prototype */
-#define _XOPEN_SOURCE_EXTENDED /* same as above */
-#define __EXTENSIONS__ /* needed on solaris: if XOPEN_SOURCE is defined
-                          struct timeval defintion from <sys/time.h> won't
-                          be included => workarround define _EXTENSIONS_
-                           -andrei */
 #include <unistd.h>
 #include <unistd.h>
 #include <sys/time.h>    
 #include <sys/time.h>