server.c (find_shell): New function.
* fixinc/server.c (find_shell): New function. Avoid $SHELL. (run_shell): Use it. From-SVN: r32878
This commit is contained in:
parent
7bfe3c970f
commit
bebac70175
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
* Makefile.in (stmp-int-hdrs): Make include subdir here...
|
||||
|
@ -235,6 +235,28 @@ server_setup ()
|
||||
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
|
||||
@ -266,6 +288,8 @@ run_shell (pz_cmd)
|
||||
THEN try to start it. */
|
||||
if (server_id == NULLPROCESS)
|
||||
{
|
||||
def_args[0] = find_shell ();
|
||||
|
||||
server_id = proc2_fopen (&server_pair, def_args);
|
||||
if (server_id > 0)
|
||||
server_setup ();
|
||||
|
Loading…
Reference in New Issue
Block a user