Skip to contentSkip to conversation

Rename DOWAIT_NORMAL to DOWAIT_NONBLOCK

PATCH In review Denys Vlasenko 2 participants 2 messages Feb 19, 2020 – Apr 29, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Rename DOWAIT_NORMAL to DOWAIT_NONBLOCK

To make it clearer what it is doing: nonblocking wait()

---
 src/jobs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
src/jobs.c +4 -4
index 26a6248..d0cf708 100644
@@ -77,7 +77,7 @@
 #define CUR_STOPPED 0
 
 /* mode flags for dowait */
-#define DOWAIT_NORMAL 0
+#define DOWAIT_NONBLOCK 0
 #define DOWAIT_BLOCK 1
 #define DOWAIT_WAITCMD 2
 
@@ -557,7 +557,7 @@ showjobs(struct output *out, int mode)
 	TRACE(("showjobs(%x) called\n", mode));
 
 	/* If not even one one job changed, there is nothing to do */
-	dowait(DOWAIT_NORMAL, NULL);
+	dowait(DOWAIT_NONBLOCK, NULL);
 
 	for (jp = curjob; jp; jp = jp->prev_job) {
 		if (!(mode & SHOW_CHANGED) || jp->changed)
@@ -1013,7 +1013,7 @@ waitforjob(struct job *jp)
 	int st;
 
 	TRACE(("waitforjob(%%%d) called\n", jp ? jobno(jp) : 0));
-	dowait(jp ? DOWAIT_BLOCK : DOWAIT_NORMAL, jp);
+	dowait(jp ? DOWAIT_BLOCK : DOWAIT_NONBLOCK, jp);
 	if (!jp)
 		return exitstatus;
 
@@ -1123,7 +1123,7 @@ out:
 
 static int dowait(int block, struct job *jp)
 {
-	int pid = block == DOWAIT_NORMAL ? gotsigchld : 1;
+	int pid = block == DOWAIT_NONBLOCK ? gotsigchld : 1;
 
 	while (jp ? jp->state == JOBRUNNING : pid > 0) {
 		if (!jp)
Signature · 1 line
2.25.0
#1 lore raw
Quoted 6 lines · Denys Vlasenko

To make it clearer what it is doing: nonblocking wait()

---
 src/jobs.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt