From 53dab360a1e0dddcfd83c6cbfc9f720f5e233550 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 26 Oct 2016 19:28:29 +0200 Subject: trap: Globally rename pendingsigs to pending_sig This variable does not contain "sigs" (plural). It contains either 0 or (one) signal number of a pending signal. For someone unfamiliar with this code, "pendingsigs" name is confusing - it hints at being an array or bit mask of pending singnals. Signed-off-by: Denys Vlasenko CC: dash@vger.kernel.org Signed-off-by: Herbert Xu --- src/jobs.c | 4 ++-- src/miscbltin.c | 2 +- src/trap.c | 10 +++++----- src/trap.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/jobs.c b/src/jobs.c index 4f02e38..f0d34ab 100644 --- a/src/jobs.c +++ b/src/jobs.c @@ -648,7 +648,7 @@ out: return retval; sigout: - retval = 128 + pendingsigs; + retval = 128 + pending_sig; goto out; } @@ -1147,7 +1147,7 @@ waitproc(int block, int *status) sigfillset(&mask); sigprocmask(SIG_SETMASK, &mask, &oldmask); - while (!gotsigchld && !pendingsigs) + while (!gotsigchld && !pending_sig) sigsuspend(&oldmask); sigclearmask(); diff --git a/src/miscbltin.c b/src/miscbltin.c index 39b9c47..5ccbbcb 100644 --- a/src/miscbltin.c +++ b/src/miscbltin.c @@ -152,7 +152,7 @@ readcmd(int argc, char **argv) case 1: break; default: - if (errno == EINTR && !pendingsigs) + if (errno == EINTR && !pending_sig) continue; /* fall through */ case 0: diff --git a/src/trap.c b/src/trap.c index edb9938..69eb8ab 100644 --- a/src/trap.c +++ b/src/trap.c @@ -73,7 +73,7 @@ char sigmode[NSIG - 1]; /* indicates specified signal received */ static char gotsig[NSIG - 1]; /* last pending signal */ -volatile sig_atomic_t pendingsigs; +volatile sig_atomic_t pending_sig; /* received SIGCHLD */ int gotsigchld; @@ -291,7 +291,7 @@ onsig(int signo) } gotsig[signo - 1] = 1; - pendingsigs = signo; + pending_sig = signo; if (signo == SIGINT && !trap[SIGINT]) { if (!suppressint) @@ -314,7 +314,7 @@ void dotrap(void) int i; int status, last_status; - if (!pendingsigs) + if (!pending_sig) return; status = savestatus; @@ -323,7 +323,7 @@ void dotrap(void) status = exitstatus; savestatus = status; } - pendingsigs = 0; + pending_sig = 0; barrier(); for (i = 0, q = gotsig; i < NSIG - 1; i++, q++) { @@ -331,7 +331,7 @@ void dotrap(void) continue; if (evalskip) { - pendingsigs = i + 1; + pending_sig = i + 1; break; } diff --git a/src/trap.h b/src/trap.h index 7573fd7..b9dfcf2 100644 --- a/src/trap.h +++ b/src/trap.h @@ -38,7 +38,7 @@ extern int trapcnt; extern char sigmode[]; -extern volatile sig_atomic_t pendingsigs; +extern volatile sig_atomic_t pending_sig; extern int gotsigchld; int trapcmd(int, char **); -- cgit 1.4.1 amp;showmsg=1&follow=1'>Expand)Author 2022-07-28Use tiparm on to_status_lineJune McEnroe 2022-06-26Only show old topic if something was removedJune McEnroe 2022-06-24Use two lines to show topic diffsJune McEnroe 2022-05-29Allow setting fallback nicks and highlight on anyJune McEnroe 2022-05-29Document visibility of unknown repliesJune McEnroe 2022-05-29Put unknown numerics in parenthesesJune McEnroe 2022-05-08Route unknown channel replies to channelsJune McEnroe 2022-05-08Show "You arrive" message only onceJune McEnroe 2022-05-08Write unknown replies to Network with Ice heatJune McEnroe 2022-04-20Sanitize leading dots from log path componentsJune McEnroe 2022-03-31Add screenshot to READMEJune McEnroe 2022-03-16Skip non-spacing when moving and deleting by "character"June McEnroe 2022-03-13Document using -S to connect over IPv4 or IPv6June McEnroe 2022-03-09Always refresh the screen with ^LChristian Kellermann 2022-03-05Update STANDARDS section authors, titles and URLsJune McEnroe 2022-03-02Show own nick on /nick without paramsJune McEnroe 2022-02-26Specify commands which depend on capsJune McEnroe 2022-02-26Only add available commands to completeJune McEnroe 2022-02-26Factor out commandAvailableJune McEnroe 2022-02-23Give examples of "general events" 2.1June McEnroe 2022-02-23Add missing unistd.h include in input.cJune McEnroe 2022-02-22Document the interfaceJune McEnroe 2022-02-20Clean up unimplemented editing mode stuffJune McEnroe 2022-02-20Save input buffer contentsJune McEnroe 2022-02-20Share a cut buffer between all edit buffersJune McEnroe 2022-02-20Assert return values in edit testsJune McEnroe 2022-02-20Move mbs out of struct Edit, use a global bufferJune McEnroe 2022-02-20Clear edit buffer before running commandJune McEnroe 2022-02-20Show indicator in status when window has pending inputJune McEnroe 2022-02-20Use separate edit buffers for each IDJune McEnroe 2022-02-20Make sure new cap is actually larger than new lengthJune McEnroe 2022-02-20Remove unused mbs.len field from struct EditJune McEnroe 2022-02-19Remove unneeded includes in ui.cJune McEnroe 2022-02-19Reimplement tab completeJune McEnroe 2022-02-19Handle errors from editFn, etc.June McEnroe 2022-02-19Reimplement text macrosJune McEnroe 2022-02-19Factor out input handling to input.cJune McEnroe 2022-02-19Factor out window management to window.cJune McEnroe 2022-02-19Enable -Wmissing-prototypesJune McEnroe 2022-02-19Fix edit.[ch] license notice additional permissionsJune McEnroe 2022-02-19Run line editing testsJune McEnroe 2022-02-18Implement new line editing "library"June McEnroe 2022-02-18Simplify cursor positioning in inputJune McEnroe 2022-02-18Fix M-f orderingJune McEnroe 2022-02-12Move sandman build to scripts/MakefileJune McEnroe 2022-02-12Use compat_readpassphrase.c on LinuxJune McEnroe 2022-02-12Copy RPP defines from oconfigureJune McEnroe