aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-03-01 11:18:33 +0000
committerRon Yorston <rmy@pobox.com>2018-03-01 11:18:33 +0000
commit5f8dac68690e92f0be220f8f8d9f797a2aedc806 (patch)
tree28c1d611ace374f615cac23415b35b2ab54059f4 /shell
parent701a8d6783f09597e1c9b386b1e6ba890807854c (diff)
downloadbusybox-w32-5f8dac68690e92f0be220f8f8d9f797a2aedc806.tar.gz
busybox-w32-5f8dac68690e92f0be220f8f8d9f797a2aedc806.tar.bz2
busybox-w32-5f8dac68690e92f0be220f8f8d9f797a2aedc806.zip
Remove fake signal-handling code
Microsoft Windows has only limited support for signals. busybox-w32 initially papered over this fact by adding definitions for unsupported signals and signal-handling functions. Remove this fake code and deal with the consequences by excluding anything that fails to compile as a result.
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c
index fa71bd84d..88834f49a 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -3747,6 +3747,7 @@ static smallint doing_jobctl; //references:8
3747static void setjobctl(int); 3747static void setjobctl(int);
3748#endif 3748#endif
3749 3749
3750#if !ENABLE_PLATFORM_MINGW32
3750/* 3751/*
3751 * Ignore a signal. 3752 * Ignore a signal.
3752 */ 3753 */
@@ -3761,7 +3762,6 @@ ignoresig(int signo)
3761 sigmode[signo - 1] = S_HARD_IGN; 3762 sigmode[signo - 1] = S_HARD_IGN;
3762} 3763}
3763 3764
3764#if !ENABLE_PLATFORM_MINGW32
3765/* 3765/*
3766 * Only one usage site - in setsignal() 3766 * Only one usage site - in setsignal()
3767 */ 3767 */
@@ -3896,6 +3896,7 @@ setsignal(int signo)
3896} 3896}
3897#else 3897#else
3898#define setsignal(s) 3898#define setsignal(s)
3899#define ignoresig(s)
3899#endif 3900#endif
3900 3901
3901/* mode flags for set_curjob */ 3902/* mode flags for set_curjob */
@@ -4372,7 +4373,11 @@ sprint_status48(char *s, int status, int sigonly)
4372#endif 4373#endif
4373 st = WTERMSIG(status); 4374 st = WTERMSIG(status);
4374 if (sigonly) { 4375 if (sigonly) {
4376#ifdef SIGPIPE
4375 if (st == SIGINT || st == SIGPIPE) 4377 if (st == SIGINT || st == SIGPIPE)
4378#else
4379 if (st == SIGINT)
4380#endif
4376 goto out; 4381 goto out;
4377#if JOBS 4382#if JOBS
4378 if (WIFSTOPPED(status)) 4383 if (WIFSTOPPED(status))
@@ -10633,7 +10638,7 @@ evalcommand(union node *cmd, int flags)
10633 * we can just exec it. 10638 * we can just exec it.
10634 */ 10639 */
10635#if ENABLE_PLATFORM_MINGW32 10640#if ENABLE_PLATFORM_MINGW32
10636 if (!(flags & EV_EXIT) || trap[0]) { 10641 if (!(flags & EV_EXIT) || may_have_traps) {
10637 /* No, forking off a child is necessary */ 10642 /* No, forking off a child is necessary */
10638 struct forkshell fs; 10643 struct forkshell fs;
10639 10644
@@ -14394,6 +14399,7 @@ init(void)
14394 basepf.next_to_pgetc = basepf.buf = ckmalloc(IBUFSIZ); 14399 basepf.next_to_pgetc = basepf.buf = ckmalloc(IBUFSIZ);
14395 basepf.linno = 1; 14400 basepf.linno = 1;
14396 14401
14402#if !ENABLE_PLATFORM_MINGW32
14397 sigmode[SIGCHLD - 1] = S_DFL; /* ensure we install handler even if it is SIG_IGNed */ 14403 sigmode[SIGCHLD - 1] = S_DFL; /* ensure we install handler even if it is SIG_IGNed */
14398 setsignal(SIGCHLD); 14404 setsignal(SIGCHLD);
14399 14405
@@ -14401,6 +14407,7 @@ init(void)
14401 * Try: "trap '' HUP; bash; echo RET" and type "kill -HUP $$" 14407 * Try: "trap '' HUP; bash; echo RET" and type "kill -HUP $$"
14402 */ 14408 */
14403 signal(SIGHUP, SIG_DFL); 14409 signal(SIGHUP, SIG_DFL);
14410#endif
14404 14411
14405 { 14412 {
14406 char **envp; 14413 char **envp;
@@ -14838,7 +14845,7 @@ forkshell_openhere(struct forkshell *fs)
14838 ignoresig(SIGQUIT); //signal(SIGQUIT, SIG_IGN); 14845 ignoresig(SIGQUIT); //signal(SIGQUIT, SIG_IGN);
14839 ignoresig(SIGHUP); //signal(SIGHUP, SIG_IGN); 14846 ignoresig(SIGHUP); //signal(SIGHUP, SIG_IGN);
14840 ignoresig(SIGTSTP); //signal(SIGTSTP, SIG_IGN); 14847 ignoresig(SIGTSTP); //signal(SIGTSTP, SIG_IGN);
14841 signal(SIGPIPE, SIG_DFL); 14848 //signal(SIGPIPE, SIG_DFL);
14842 if (redir->type == NHERE) { 14849 if (redir->type == NHERE) {
14843 size_t len = strlen(redir->nhere.doc->narg.text); 14850 size_t len = strlen(redir->nhere.doc->narg.text);
14844 full_write(pip[1], redir->nhere.doc->narg.text, len); 14851 full_write(pip[1], redir->nhere.doc->narg.text, len);