Skip to content
Snippets Groups Projects
Commit 53dab360 authored by Denys Vlasenko's avatar Denys Vlasenko Committed by Herbert Xu
Browse files

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: default avatarDenys Vlasenko <dvlasenk@redhat.com>
CC: dash@vger.kernel.org
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent afe0e015
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -648,7 +648,7 @@ out:
return retval;
 
sigout:
retval = 128 + pendingsigs;
retval = 128 + pending_sig;
goto out;
}
 
Loading
Loading
@@ -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();
Loading
Loading
Loading
Loading
@@ -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:
Loading
Loading
Loading
Loading
@@ -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;
 
Loading
Loading
@@ -291,7 +291,7 @@ onsig(int signo)
}
 
gotsig[signo - 1] = 1;
pendingsigs = signo;
pending_sig = signo;
 
if (signo == SIGINT && !trap[SIGINT]) {
if (!suppressint)
Loading
Loading
@@ -314,7 +314,7 @@ void dotrap(void)
int i;
int status, last_status;
 
if (!pendingsigs)
if (!pending_sig)
return;
 
status = savestatus;
Loading
Loading
@@ -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++) {
Loading
Loading
@@ -331,7 +331,7 @@ void dotrap(void)
continue;
 
if (evalskip) {
pendingsigs = i + 1;
pending_sig = i + 1;
break;
}
 
Loading
Loading
Loading
Loading
@@ -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 **);
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment