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

@ -263,7 +263,6 @@ struct shared
Namval_t *typeinit; \
Namfun_t nvfun; \
char *mathnodes; \
void *coshell; \
char *bltin_dir; \
struct Regress_s*regress;
@ -437,11 +436,6 @@ extern int sh_type(const char*);
extern void sh_unscope(Shell_t*);
extern void sh_utol(const char*, char*);
extern int sh_whence(char**,int);
#if SHOPT_COSHELL
extern int sh_coaddfile(Shell_t*,char*);
extern int sh_copipe(Shell_t*, int[], int);
extern int sh_coaccept(Shell_t*,int[],int);
#endif /* SHOPT_COSHELL */
#if SHOPT_NAMESPACE
extern Namval_t *sh_fsearch(Shell_t*,const char *,int);
#endif /* SHOPT_NAMESPACE */

View file

@ -34,22 +34,6 @@
#endif /* !SIGINT */
#include "FEATURE/options"
#if SHOPT_COSHELL
# include <coshell.h>
# define COPID_BIT (1L<<30)
struct cosh
{
struct cosh *next;
Coshell_t *coshell;
Cojob_t *cojob;
char *name;
short id;
};
extern pid_t sh_copid(struct cosh*);
extern char *sh_pid2str(Shell_t*,pid_t);
#endif /* SHOPT_COSHELL */
#undef JOBS
#if defined(SIGCLD) && !defined(SIGCHLD)
# define SIGCHLD SIGCLD
@ -76,9 +60,6 @@ struct process
struct process *p_nxtjob; /* next job structure */
struct process *p_nxtproc; /* next process in current job */
Shell_t *p_shp; /* shell that posted the job */
#if SHOPT_COSHELL
Cojob_t *p_cojob; /* coshell job */
#endif /* SHOPT_COSHELL */
int *p_exitval; /* place to store the exitval */
pid_t p_pid; /* process id */
pid_t p_pgrp; /* process group */
@ -120,9 +101,6 @@ struct jobs
char waitall; /* wait for all jobs in pipe */
char toclear; /* job table needs clearing */
unsigned char *freejobs; /* free jobs numbers */
#if SHOPT_COSHELL
struct cosh *colist; /* coshell job list */
#endif /* SHOPT_COSHELL */
};
/* flags for joblist */