← Commit list

9d4dc84a7

Johannes Schindelin
Johannes Schindelin
2017-07-15
SUCCESS Duration: 141s

Subject

ash: protect WIFSTOPPED use with #if JOBS

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/ash.c+9 -3
@@ -4022,15 +4022,19 @@ sprint_status48(char *s, int status, int sigonly)
col = 0;
if (!WIFEXITED(status)) {
- if (JOBS && WIFSTOPPED(status))
+#if JOBS
+ if (WIFSTOPPED(status))
st = WSTOPSIG(status);
else
+#endif
st = WTERMSIG(status);
if (sigonly) {
if (st == SIGINT || st == SIGPIPE)
goto out;
- if (JOBS && WIFSTOPPED(status))
+#if JOBS
+ if (WIFSTOPPED(status))
goto out;
+#endif
}
st &= 0x7f;
//TODO: use bbox's get_signame? strsignal adds ~600 bytes to text+rodata
@@ -4182,8 +4186,10 @@ dowait(int block, struct job *job)
goto out;
}
/* The process wasn't found in job list */
- if (JOBS && !WIFSTOPPED(status))
+#if JOBS
+ if (!WIFSTOPPED(status))
jobless--;
+#endif
out:
INT_ON;