esh: incorrect references to pid in wait_for_child

This commit is contained in:
K. Lange 2018-10-28 19:40:08 +09:00
parent 0995d14106
commit b06248b631
1 changed files with 2 additions and 2 deletions

View File

@ -768,11 +768,11 @@ int wait_for_child(int pgid, char * name) {
if (name) {
hashmap_set(job_hash, (void*)pgid, strdup(name));
}
fprintf(stderr, "[%d] Stopped\t\t%s\n", pid, (char*)hashmap_get(job_hash, (void*)pid));
fprintf(stderr, "[%d] Stopped\t\t%s\n", pgid, (char*)hashmap_get(job_hash, (void*)pgid));
break;
} else {
suspended_pgid = 0;
hashmap_remove(job_hash, (void*)pid);
hashmap_remove(job_hash, (void*)pgid);
}
} while (outpid != -1 || (outpid == -1 && errno != ECHILD));
reset_pgrp();