[gdm/gnome-2-30] Use a configure check for prctl
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdm/gnome-2-30] Use a configure check for prctl
- Date: Wed, 16 Jun 2010 18:02:20 +0000 (UTC)
commit 614ddd800e42f6e52ac1fd65cd66b3d699e9cf50
Author: William Jon McCann <jmccann redhat com>
Date: Wed Jun 16 14:01:17 2010 -0400
Use a configure check for prctl
configure.ac | 6 ++++++
daemon/gdm-server.c | 5 +++--
daemon/gdm-session-worker-job.c | 4 ++--
3 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5bff081..28dd4f0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -943,6 +943,12 @@ dnl ---------------------------------------------------------------------------
AC_CHECK_HEADERS(execinfo.h)
dnl ---------------------------------------------------------------------------
+dnl check for process control
+dnl ---------------------------------------------------------------------------
+
+AC_CHECK_HEADERS(sys/prctl.h)
+
+dnl ---------------------------------------------------------------------------
dnl - Define some variables to represent the directories we use.
dnl ---------------------------------------------------------------------------
diff --git a/daemon/gdm-server.c b/daemon/gdm-server.c
index 7a1c840..e7560a3 100644
--- a/daemon/gdm-server.c
+++ b/daemon/gdm-server.c
@@ -33,7 +33,8 @@
#include <grp.h>
#include <signal.h>
#include <sys/resource.h>
-#if defined (__linux__)
+
+#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h>
#endif
@@ -468,7 +469,7 @@ server_child_setup (GdmServer *server)
sigprocmask (SIG_SETMASK, &mask, NULL);
/* Terminate the process when the parent dies */
-#if defined (__linux__)
+#ifdef HAVE_SYS_PRCTL_H
prctl (PR_SET_PDEATHSIG, SIGTERM);
#endif
diff --git a/daemon/gdm-session-worker-job.c b/daemon/gdm-session-worker-job.c
index 149d83a..f359f4f 100644
--- a/daemon/gdm-session-worker-job.c
+++ b/daemon/gdm-session-worker-job.c
@@ -32,7 +32,7 @@
#include <pwd.h>
#include <grp.h>
#include <signal.h>
-#if defined (__linux__)
+#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h>
#endif
@@ -88,7 +88,7 @@ static void
session_worker_job_child_setup (GdmSessionWorkerJob *session_worker_job)
{
/* Terminate the process when the parent dies */
-#if defined (__linux__)
+#ifdef HAVE_SYS_PRCTL_H
prctl (PR_SET_PDEATHSIG, SIGTERM);
#endif
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]