Commit bebac701 by Felix Lee Committed by Jeff Law

server.c (find_shell): New function.

        * fixinc/server.c (find_shell): New function.  Avoid $SHELL.
        (run_shell): Use it.

From-SVN: r32878
parent 7bfe3c97
2000-04-03 Felix Lee <flee@cygnus.com>
* fixinc/server.c (find_shell): New function. Avoid $SHELL.
(run_shell): Use it.
2000-04-03 Jonathan Larmour <jlarmour@redhat.co.uk> 2000-04-03 Jonathan Larmour <jlarmour@redhat.co.uk>
* Makefile.in (stmp-int-hdrs): Make include subdir here... * Makefile.in (stmp-int-hdrs): Make include subdir here...
......
...@@ -235,6 +235,28 @@ server_setup () ...@@ -235,6 +235,28 @@ server_setup ()
p_cur_dir = getcwd ((char *) NULL, MAXPATHLEN + 1); p_cur_dir = getcwd ((char *) NULL, MAXPATHLEN + 1);
} }
/*
* find_shell
*
* Locate a shell suitable for use. For various reasons
* (like the use of "trap" in server_setup(), it must be a
* Bourne-like shell.
*
* Most of the time, /bin/sh is preferred, but sometimes
* it's quite broken (like on Ultrix). autoconf lets you
* override with $CONFIG_SHELL, so we do the same.
*/
static char *
find_shell ()
{
char * shell = getenv ("CONFIG_SHELL");
if (shell)
return shell;
return "/bin/sh";
}
/* /*
* run_shell * run_shell
...@@ -266,6 +288,8 @@ run_shell (pz_cmd) ...@@ -266,6 +288,8 @@ run_shell (pz_cmd)
THEN try to start it. */ THEN try to start it. */
if (server_id == NULLPROCESS) if (server_id == NULLPROCESS)
{ {
def_args[0] = find_shell ();
server_id = proc2_fopen (&server_pair, def_args); server_id = proc2_fopen (&server_pair, def_args);
if (server_id > 0) if (server_id > 0)
server_setup (); server_setup ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment