aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDaniel Colascione2015-03-24 10:23:14 -0700
committerDaniel Colascione2015-03-24 10:23:24 -0700
commit23a98c7a538fd6da43eba522c3db8e53c1edd1ac (patch)
tree4348d5215881991d9302a7fbe8bc2ffa1576edf3 /src
parent71fdbd770bf06ad48bcb165e85b59778abc9ed06 (diff)
downloademacs-23a98c7a538fd6da43eba522c3db8e53c1edd1ac.tar.gz
emacs-23a98c7a538fd6da43eba522c3db8e53c1edd1ac.zip
Make process-running-child-p return foreground process group ID
* etc/NEWS: Mention change to `process-running-child-p`. * src/process.c (Fprocess_running_child_p): Return number identifier of the foreground process group if we know it.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/process.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 99b7ec731fe..815c117308b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12015-03-24 Daniel Colascione <dancol@dancol.org>
2
3 * process.c (Fprocess_running_child_p): Return number identifier of
4 the foreground process group if we know it.
5
12015-03-23 Paul Eggert <eggert@cs.ucla.edu> 62015-03-23 Paul Eggert <eggert@cs.ucla.edu>
2 7
3 Minor refactoring of new Fmake_process code 8 Minor refactoring of new Fmake_process code
diff --git a/src/process.c b/src/process.c
index dd61f3008de..3fe8644b48a 100644
--- a/src/process.c
+++ b/src/process.c
@@ -5739,9 +5739,10 @@ emacs_get_tty_pgrp (struct Lisp_Process *p)
5739 5739
5740DEFUN ("process-running-child-p", Fprocess_running_child_p, 5740DEFUN ("process-running-child-p", Fprocess_running_child_p,
5741 Sprocess_running_child_p, 0, 1, 0, 5741 Sprocess_running_child_p, 0, 1, 0,
5742 doc: /* Return t if PROCESS has given the terminal to a child. 5742 doc: /* Return non-nil if PROCESS has given the terminal to a
5743If the operating system does not make it possible to find out, 5743child. If the operating system does not make it possible to find out,
5744return t unconditionally. */) 5744return t. If we can find out, return the numeric ID of the foreground
5745process group. */)
5745 (Lisp_Object process) 5746 (Lisp_Object process)
5746{ 5747{
5747 /* Initialize in case ioctl doesn't exist or gives an error, 5748 /* Initialize in case ioctl doesn't exist or gives an error,
@@ -5764,6 +5765,8 @@ return t unconditionally. */)
5764 5765
5765 if (gid == p->pid) 5766 if (gid == p->pid)
5766 return Qnil; 5767 return Qnil;
5768 if (gid != -1)
5769 return make_number (gid);
5767 return Qt; 5770 return Qt;
5768} 5771}
5769 5772