summaryrefslogtreecommitdiffstats
path: root/monop/misc.c
diff options
context:
space:
mode:
authormycroft <mycroft@NetBSD.org>1993-08-07 08:27:53 +0000
committermycroft <mycroft@NetBSD.org>1993-08-07 08:27:53 +0000
commit2cf6c0757b6b0b6a5d897b1f4d34417a919a2e5d (patch)
tree1a2cb27e0c7cff39de1cd3007e6cea4b97782935 /monop/misc.c
parentfff970121118fba4dda5b1df821221703499ca49 (diff)
downloadbsdgames-darwin-2cf6c0757b6b0b6a5d897b1f4d34417a919a2e5d.tar.gz
bsdgames-darwin-2cf6c0757b6b0b6a5d897b1f4d34417a919a2e5d.tar.zst
bsdgames-darwin-2cf6c0757b6b0b6a5d897b1f4d34417a919a2e5d.zip
New version from uunet.
Diffstat (limited to 'monop/misc.c')
-rw-r--r--monop/misc.c91
1 files changed, 2 insertions, 89 deletions
diff --git a/monop/misc.c b/monop/misc.c
index f031cad0..114994e5 100644
--- a/monop/misc.c
+++ b/monop/misc.c
@@ -32,35 +32,14 @@
*/
#ifndef lint
-/*static char sccsid[] = "from: @(#)misc.c 5.5 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: misc.c,v 1.2 1993/08/01 18:53:37 mycroft Exp $";
+/*static char sccsid[] = "from: @(#)misc.c 5.6 (Berkeley) 3/25/93";*/
+static char rcsid[] = "$Id: misc.c,v 1.3 1993/08/07 08:27:57 mycroft Exp $";
#endif /* not lint */
# include "monop.ext"
# include <ctype.h>
# include <signal.h>
-# define execsh(sh) execl(sh, shell_name[roll(1, num_names)-1], 0)
-
-static char *shell_def = "/bin/csh",
- *shell_name[] = {
- ".Hi Mom!",
- ".Kick Me",
- ".I'm really the next process down",
- ".Hi Kids!",
- ".This space for rent",
- ".Singin' in the rain....",
- ".I am but a Cog in the Wheel of Life",
- ".Look out!!! Behind you!!!!!",
- ".Looking for a good time, sailor?",
- ".I don't get NO respect...",
- ".Augghh! You peeked!"
- };
-
-static int num_names = sizeof shell_name / sizeof (char *);;
-
-char *shell_in();
-
/*
* This routine executes a truncated set of commands until a
* "yes or "no" answer is gotten.
@@ -292,69 +271,3 @@ reg int *s1, *s2, size; {
while (size--)
*s1++ = *s2++;
}
-/*
- * This routine forks off a shell. It uses the users login shell
- */
-shell_out() {
-
- static char *shell = NULL;
-
- printline();
- if (shell == NULL)
- shell = shell_in();
- fflush(stdout);
- if (!fork()) {
- signal(SIGINT, SIG_DFL);
- execsh(shell);
- }
- ignoresigs();
- wait();
- resetsigs();
- putchar('\n');
- printline();
-}
-/*
- * This routine looks up the users login shell
- */
-# include <sys/types.h>
-# include <pwd.h>
-
-char *getenv();
-
-char *
-shell_in() {
-
- reg struct passwd *pp;
- reg char *sp;
-
- if ((sp = getenv("SHELL")) == NULL) {
- pp = getpwuid(getuid());
- if (pp->pw_shell[0] != '\0')
- return pp->pw_shell;
- else
- return shell_def;
- /*return (*(pp->pw_shell) != '\0' ? pp->pw_shell : shell_def);*/
- }
- return sp;
-}
-/*
- * This routine sets things up to ignore all the signals.
- */
-ignoresigs() {
-
- reg int i;
-
- for (i = 0; i < NSIG; i++)
- signal(i, SIG_IGN);
-}
-/*
- * This routine sets up things as they were before.
- */
-resetsigs() {
-
- reg int i;
-
- for (i = 0; i < NSIG; i++)
- signal(i, SIG_DFL);
- signal(SIGINT, quit);
-}