From 5ef61a44b12773eccd5de43acb18118eca09de29 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Wed, 5 Jun 2002 14:57:05 +0000 Subject: 17265: make the jobs command work in subshells --- Src/Modules/clone.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'Src/Modules/clone.c') diff --git a/Src/Modules/clone.c b/Src/Modules/clone.c index 11387fc90..1a41b7448 100644 --- a/Src/Modules/clone.c +++ b/Src/Modules/clone.c @@ -53,7 +53,7 @@ bin_clone(char *nam, char **args, char *ops, int func) } pid = fork(); if (!pid) { - clearjobtab(); + clearjobtab(0); ppid = getppid(); mypid = getpid(); #ifdef HAVE_SETSID @@ -61,7 +61,7 @@ bin_clone(char *nam, char **args, char *ops, int func) zwarnnam(nam, "failed to create new session: %e", NULL, errno); #endif #ifdef TIOCNOTTY - if (ioctl(SHTTY, TIOCNOTTY)) + if (ioctl(SHTTY, TIOCNOTTY, 0)) zwarnnam(nam, "%e", NULL, errno); setpgrp(0L, mypid); #endif @@ -98,18 +98,29 @@ static struct builtin bintab[] = { /**/ int -boot_clone(Module m) +setup_(Module m) { - return !addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)); + return 0; } -#ifdef MODULE +/**/ +int +boot_(Module m) +{ + return !addbuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)); +} /**/ int -cleanup_clone(Module m) +cleanup_(Module m) { deletebuiltins(m->nam, bintab, sizeof(bintab)/sizeof(*bintab)); return 0; } -#endif + +/**/ +int +finish_(Module m) +{ + return 0; +} -- cgit 1.4.1