mirror of
https://github.com/RustyRaptor/parallel-programming.git
synced 2026-12-03 15:55:15 -07:00
refactor
This commit is contained in:
1 parent
3e3ef43b56
commit
27d6b90344
1 file changed
+5
-2
@@ -220,7 +220,10 @@ int main(int argc, char const *argv[])
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
shmctl(shmid, IPC_RMID, NULL);
|
||||
if (shmctl(shmid, IPC_RMID, NULL) < 0) {
|
||||
perror("Cant delete shared memory");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -370,7 +373,7 @@ int count3s_parallel_proc()
|
||||
}
|
||||
childcnt++;
|
||||
}
|
||||
|
||||
|
||||
int pid;
|
||||
while (childcnt > 0) {
|
||||
pid = wait(NULL);
|
||||
|
||||
Reference in new issue
Block a user