[gdm] Use a configure check for prctl



commit 1955cc272b8c8884615ce40d1c5fee0afa562df1
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 ad45148..70ab8ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -946,6 +946,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 dbe29ef..688118d 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]