Fix warnings when compiling under clang

Introduced by #4849 (add wait for processes by name)

../src/builtin_wait.cpp:23:14: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
    while (j = jobs.next()) {
           ~~^~~~~~~~~~~~~
../src/builtin_wait.cpp:23:14: note: place parentheses around the assignment to silence this warning
    while (j = jobs.next()) {
             ^
           (              )
../src/builtin_wait.cpp:23:14: note: use '==' to turn this assignment into an equality comparison
    while (j = jobs.next()) {
             ^
             ==
1 warning generated.
This commit is contained in:
Mahmoud Al-Qudsi
2018-05-11 11:11:53 -05:00
parent 1764716718
commit b635863509

View File

@@ -20,7 +20,7 @@ static job_id_t get_job_id_from_pid(pid_t pid) {
job_t *j;
job_iterator_t jobs;
while (j = jobs.next()) {
while ((j = jobs.next()) != nullptr) {
if (j->pgid == pid) {
return j->job_id;
}