diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-02-20 02:27:42 +0100 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-02-20 02:27:42 +0100 |
commit | 15a8eaef00219421e4b9103ef974bc9ada2d0bca (patch) | |
tree | 08e4e862e8d228a015fed287fc9a9d42d47cd143 | |
parent | 13d5a48507a4aa161ea1353e0e6913719c6d57cc (diff) | |
download | ratpoison-15a8eaef00219421e4b9103ef974bc9ada2d0bca.zip |
Kill getsid(2) check in get_child_info.
* Purpose not understood, usage can't be right on OSes where getsid
fails with EPERM if ratpoison and the argument pid are not in the
session; guess what, ratpoison calls setsid(2) in spawn()...
-rw-r--r-- | src/window.c | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/src/window.c b/src/window.c index f4ea113..a383c72 100644 --- a/src/window.c +++ b/src/window.c @@ -19,12 +19,6 @@ * Boston, MA 02111-1307 USA */ -/* Citing getsid(2) here: - To get the prototype under glibc, define both _XOPEN_SOURCE and - _XOPEN_SOURCE_EXTENDED, or use "#define _XOPEN_SOURCE n" for some - integer n larger than or equal to 500. */ -#define _XOPEN_SOURCE 500 -#include <unistd.h> /* for getsid */ #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -124,7 +118,6 @@ get_child_info (Window w) unsigned long nitems; unsigned long bytes_after; unsigned char *req; - pid_t sid; status = XGetWindowProperty (dpy, w, _net_wm_pid, 0, 0, False, XA_CARDINAL, @@ -156,24 +149,9 @@ get_child_info (Window w) PRINT_DEBUG(("pid: %d\n", pid)); - /* - The pids will hopefully be in the same session. - - XXX what's the use of this session check? - On some platforms (eg. OpenBSD) you get EPERM if `pid' is not in the - same session as ratpoison. This makes stuff like %p in winformat much - less useful... - */ - sid = getsid (pid); - if (sid == -1) - return NULL; - list_for_each_entry (cur, &rp_children, node) - { - PRINT_DEBUG(("cur->pid=%d sid=%d\n", cur->pid, getsid (cur->pid))); - if (sid == getsid (cur->pid)) - return cur; - } + if (pid == cur->pid) + return cur; return NULL; } |