mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-31 20:31:19 -03:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user