mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Make 'stop' and 'suspend' regular built-ins
The 'stop' and 'suspend' default aliases are now converted into
regular built-in commands so that 'unalias -a' does not remove
them, 'suspend' can do some sanity checks, and something like
cmd=stop; $cmd $!
will now work.
src/cmd/ksh93/bltins/trap.c:
- b_kill(): Incorporate 'stop' functionality, which is simply
setting the same flag and variable as '-s STOP' would have done.
- b_suspend(): Add simple builtin function that sends SIGSTOP to
the main shell. Check for no operands, and refuse to suspend a
login shell (which would leave the user stuck with no way out).
Also check that 'kill' succeeds; if we're in an asynchronous
subshell, it is possible the main shell no longer exists.
src/cmd/ksh93/data/aliases.c:
- Remove "stop" and "suspend" default aliases. (Why were these
conditional upon SIGTSTP when they actually issued SIGSTOP?)
src/cmd/ksh93/include/builtins.h,
src/cmd/ksh93/data/builtins.c,
src/cmd/ksh93/data/msg.c:
- Add declarations of "stop" and "suspend" regular built-ins.
- Add option strings (AST manual/--man pages) for them.
- Add e_toomanyops ("too many operands") reusable error message for
b_suspend(). Other new commands may want this at some point.
src/cmd/ksh93/sh.1:
- Remove "stop" and "suspend" default aliases.
- Document "stop" and "suspend" regular built-in commands.
This commit is contained in:
parent
add82e1984
commit
3ba4900e9c
8 changed files with 108 additions and 11 deletions
|
|
@ -86,6 +86,9 @@ extern int b_unalias(int, char*[],Shbltin_t*);
|
|||
# ifdef SIGTSTP
|
||||
extern int b_bg(int, char*[],Shbltin_t*);
|
||||
# endif /* SIGTSTP */
|
||||
# ifdef SIGSTOP
|
||||
extern int b_suspend(int, char*[],Shbltin_t*);
|
||||
# endif /* SIGSTOP */
|
||||
#endif
|
||||
|
||||
/* The following utilities are built-in because of side-effects */
|
||||
|
|
@ -131,6 +134,7 @@ extern const char e_overlimit[];
|
|||
|
||||
extern const char e_eneedsarg[];
|
||||
extern const char e_oneoperand[];
|
||||
extern const char e_toomanyops[];
|
||||
extern const char e_toodeep[];
|
||||
extern const char e_badname[];
|
||||
extern const char e_badsyntax[];
|
||||
|
|
@ -172,6 +176,10 @@ extern const char sh_opthash[];
|
|||
extern const char sh_opthist[];
|
||||
extern const char sh_optjobs[];
|
||||
extern const char sh_optkill[];
|
||||
#if defined(JOBS) && defined(SIGSTOP)
|
||||
extern const char sh_optstop[];
|
||||
extern const char sh_optsuspend[];
|
||||
#endif /* defined(JOBS) && defined(SIGSTOP) */
|
||||
extern const char sh_optksh[];
|
||||
extern const char sh_optlet[];
|
||||
extern const char sh_optprint[];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue