summaryrefslogtreecommitdiff
path: root/open.c
diff options
context:
space:
mode:
authorToby Goodwin <tjg@star.le.ac.uk>2001-10-12 10:25:58 +0100
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:22:10 +0100
commit609a278bf6e301ea9a021793de314ddcadb806ba (patch)
treef8dac56d9eccbc46d5105d0206fe607ace82c3a8 /open.c
parent14106ccc3b2cb03c8b9a1df1a1b3e3953aaee2f8 (diff)
beta: rc-1.6b3
Diffstat (limited to 'open.c')
-rw-r--r--open.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/open.c b/open.c
index bac9f2c..60555b0 100644
--- a/open.c
+++ b/open.c
@@ -43,3 +43,21 @@ extern bool makeblocking(int fd) {
}
return TRUE;
}
+
+/* make a file descriptor the same pgrp as us. Returns TRUE if
+it changes anything. */
+
+extern bool makesamepgrp(int fd) {
+ pid_t grp;
+
+ grp = getpgrp();
+
+ if (tcgetpgrp(fd) == grp)
+ return FALSE;
+
+ if (tcsetpgrp(fd, grp) < 0) {
+ uerror("tcsetgrp");
+ return FALSE;
+ }
+ return TRUE;
+}