summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <Alan.Coopersmith@sun.com>2006-03-16 21:46:55 +0000
committerAlan Coopersmith <Alan.Coopersmith@sun.com>2006-03-16 21:46:55 +0000
commit4a0e026c04bd1027641670eda68e3a65441d2b63 (patch)
treedcc0e7186e8de456a29638fdaa0b3bb611a3eaa2
parent0a224935e64342e3eec055672229212c856ea14b (diff)
Convert checks for <grp.h>, daemon(), and setpgrp arguments to autoconf
tests instead of checking OS name #ifdefs.
-rw-r--r--ChangeLog9
-rw-r--r--configure.ac6
-rw-r--r--daemon.c7
-rw-r--r--session.c4
-rw-r--r--util.c4
5 files changed, 21 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index c12188e..581a531 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/daemon.c b/daemon.c
index 5071a75..bf78aac 100644
--- a/daemon.c
+++ b/daemon.c
@@ -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()) {
diff --git a/session.c b/session.c
index af2098a..b741fbc 100644
--- a/session.c
+++ b/session.c
@@ -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
diff --git a/util.c b/util.c
index 442c7ee..145b20d 100644
--- a/util.c
+++ b/util.c
@@ -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