Skip to content

Commit f615e8f

Browse files
committed
Report potential error from shmdt properly
1 parent 91b7b97 commit f615e8f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

2018/futex-basics/futex-basic-process.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,9 @@ int main(int argc, char** argv) {
9696

9797
// Wait for the child to terminate.
9898
wait(NULL);
99-
shmdt(shared_data);
99+
if (shmdt(shared_data) < 0) {
100+
perror("shmdt");
101+
}
100102
}
101-
102103
return 0;
103104
}

0 commit comments

Comments
 (0)