1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

Remove unused libcoshell

The coshell(1) command, which is required for libcoshell to be
useful, is not known to be shipped by any distribution. It was
removed by the ksh-community fork and hence also by 93u+m (in
2940b3f5). The coshell facility as a whole is obsolete and
insecure. For a long time now, the statically linked libcoshell
library has been 40+ kilobytes of dead weight in the ksh binary.

Prior discussion (ksh2020): https://github.com/att/ast/issues/619

src/lib/libcoshell/*:
- Removed.

src/cmd/ksh93/*:
- Remove the SHOPT_COSHELL compiler option (which was enabled) and
  a lot of code that was conditional upon #ifdef SHOPT_COSHELL.

- init.c: e_version[]: Removing SHOPT_COSHELL changed the "J"
  feature identifier in ${.sh.version} to a lowercase "j", which
  was conditional upon SHOPT_BGX (background job extensions).
  But src/cmd/ksh93/RELEASE documents (at 08-12-04, on line 1188):
    | +SHOPT_BGX enables background job extensions. Noted by "J" in
    |  the version string when enabled. [...]
  That is the only available documentation. So change that "j" back
  to a "J", leaving the version string unchanged after this commit.

- jobs.c: job_walk(): We need to keep one 'job_waitsafe(SIGCHLD);'
  call that was conditional upon SHOPT_COSHELL; removing it caused
  a regression test failure in tests/sigchld.sh, 'SIGCHLD blocked
  for script at end of pipeline' (which means that until now, a ksh
  compiled without libcoshell had broken SIGCHLD handling.)

bin/package, src/cmd/INIT/package.sh:
- Don't export COSHELL variable.
This commit is contained in:
Martijn Dekker 2020-07-17 17:13:53 +01:00
parent fbc6cd4286
commit 3613da4240
39 changed files with 87 additions and 4635 deletions

View file

@ -91,14 +91,9 @@ char e_version[] = "\n@(#)$Id: Version "
#define ATTRS 1
"B"
#endif
#if SHOPT_COSHELL
#define ATTRS 1
"J"
#else
#if SHOPT_BGX
#define ATTRS 1
"j"
#endif
"J"
#endif
#if SHOPT_ACCT
#define ATTRS 1
@ -199,9 +194,6 @@ typedef struct _init_
Namfun_t SH_VERSION_init;
struct match SH_MATCH_init;
Namfun_t SH_MATH_init;
#if SHOPT_COSHELL
Namfun_t SH_JOBPOOL_init;
#endif /* SHOPT_COSHELL */
#ifdef _hdr_locale
Namfun_t LC_TYPE_init;
Namfun_t LC_NUM_init;
@ -1028,10 +1020,6 @@ static char *setdisc_any(Namval_t *np, const char *event, Namval_t *action, Namf
static const Namdisc_t SH_MATH_disc = { 0, 0, get_math, 0, setdisc_any, create_math, };
#if SHOPT_COSHELL
static const Namdisc_t SH_JOBPOOL_disc = { 0, 0, 0, 0, setdisc_any, 0, };
#endif /* SHOPT_COSHELL */
#if SHOPT_NAMESPACE
static char* get_nspace(Namval_t* np, Namfun_t *fp)
{
@ -1792,11 +1780,6 @@ static Init_t *nv_init(Shell_t *shp)
ip->SH_MATCH_init.hdr.nofree = 1;
ip->SH_MATH_init.disc = &SH_MATH_disc;
ip->SH_MATH_init.nofree = 1;
#if SHOPT_COSHELL
ip->SH_JOBPOOL_init.disc = &SH_JOBPOOL_disc;
ip->SH_JOBPOOL_init.nofree = 1;
nv_stack(SH_JOBPOOL, &ip->SH_JOBPOOL_init);
#endif /* SHOPT_COSHELL */
ip->SH_VERSION_init.disc = &SH_VERSION_disc;
ip->SH_VERSION_init.nofree = 1;
ip->LINENO_init.disc = &LINENO_disc;