diff options
author | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2006-03-16 21:46:55 +0000 |
---|---|---|
committer | Alan Coopersmith <Alan.Coopersmith@sun.com> | 2006-03-16 21:46:55 +0000 |
commit | 4a0e026c04bd1027641670eda68e3a65441d2b63 (patch) | |
tree | dcc0e7186e8de456a29638fdaa0b3bb611a3eaa2 | |
parent | 0a224935e64342e3eec055672229212c856ea14b (diff) |
Convert checks for <grp.h>, daemon(), and setpgrp arguments to autoconf
tests instead of checking OS name #ifdefs.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | daemon.c | 7 | ||||
-rw-r--r-- | session.c | 4 | ||||
-rw-r--r-- | util.c | 4 |
5 files changed, 21 insertions, 9 deletions
@@ -1,3 +1,12 @@ +2006-03-16 Alan Coopersmith <alan.coopersmith@sun.com> + + * configure.ac: + * daemon.c: + * session.c: + * util.c: + Convert checks for <grp.h>, daemon(), and setpgrp arguments to + autoconf tests instead of checking OS name #ifdefs. + 2006-03-10 Alan Coopersmith <alan.coopersmith@sun.com> * chooser.c: diff --git a/configure.ac b/configure.ac index 157572d..3a7d147 100644 --- a/configure.ac +++ b/configure.ac @@ -21,6 +21,8 @@ dnl PERFORMANCE OF THIS SOFTWARE. dnl dnl Process this file with autoconf to create configure. +dnl $XdotOrg: $ + AC_PREREQ([2.57]) AC_INIT(xdm,[1.0.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xdm) AM_INIT_AUTOMAKE([dist-bzip2]) @@ -36,6 +38,7 @@ AC_PROG_INSTALL XORG_PROG_RAWCPP AC_FUNC_FORK +AC_FUNC_SETPGRP dnl If you're looking here because you got a message that said dnl 'error: possibly undefined macro: AC_DEFINE', the source of @@ -68,6 +71,9 @@ if test "x$HAS_SETUSERCONTEXT" = "xyes" ; then [Define to 1 if you have the 'setusercontext' function.]) fi +AC_CHECK_FUNCS([daemon]) +AC_CHECK_HEADERS([grp.h]) + XTRANS_CONNECTION_FLAGS dnl Sets $SECURE_RPC to "yes" or "no" XTRANS_SECURE_RPC_FLAGS @@ -1,3 +1,4 @@ +/* $XdotOrg: $ */ /* $Xorg: daemon.c,v 1.4 2001/02/09 02:05:40 xorgcvs Exp $ */ /* @@ -58,10 +59,6 @@ from The Open Group. #include "dm.h" #include "dm_error.h" -#if defined(__GLIBC__) || defined(CSRG_BASED) -#define HAS_DAEMON -#endif - #ifndef X_NOT_POSIX #define HAS_SETSID #endif @@ -105,7 +102,7 @@ BecomeDaemon (void) { /* If our C library has the daemon() function, just use it. */ -#ifdef HAS_DAEMON +#ifdef HAVE_DAEMON daemon (0, 0); #else switch (fork()) { @@ -1,4 +1,4 @@ -/* $XdotOrg: app/xdm/session.c,v 1.3 2005/11/08 06:33:31 jkj Exp $ */ +/* $XdotOrg: app/xdm/session.c,v 1.4 2006/02/25 02:21:51 alanc Exp $ */ /* $Xorg: session.c,v 1.8 2001/02/09 02:05:40 xorgcvs Exp $ */ /* @@ -76,7 +76,7 @@ extern int key_setnet(struct key_netstarg *arg); static int runAndWait (char **args, char **environ); -#if defined(CSRG_BASED) || defined(__osf__) || defined(__DARWIN__) || defined(__QNXNTO__) || defined(sun) || defined(__GLIBC__) || defined(__SCO__) +#ifdef HAVE_GRP_H # include <sys/types.h> # include <grp.h> #else @@ -1,4 +1,4 @@ -/* $XdotOrg: util.c,v 1.4 2001/02/09 02:05:41 xorgcvs Exp $ */ +/* $XdotOrg: app/xdm/util.c,v 1.3 2005/11/08 06:33:31 jkj Exp $ */ /* $Xorg: util.c,v 1.4 2001/02/09 02:05:41 xorgcvs Exp $ */ /* @@ -244,7 +244,7 @@ CleanUpChild (void) #ifdef CSRG_BASED setsid(); #else -#if defined(SYSV) || defined(SVR4) || defined(__CYGWIN__) +#ifdef SETPGRP_VOID #if !(defined(SVR4) && defined(i386)) setpgrp (); #endif |