Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit cdb1b1b8 authored by Bao Haojun's avatar Bao Haojun
Browse files

Fix deadlocks.



1. Close pipe fds[1] as soon as possible. Otherwise it may block when
   reading from fds[0] even though the child process has exited early
   and closed its copy of fds[1].

2. Waitpid after pipe is closed. Otherwise the screencap child process
   may block while writing fds[1], because the fds[0] is not closed
   yet. If we close fds[0] first, then the screencap child process will
   die because of SIGPIPE, and waitpid will return correctly.

Change-Id: I433c95a5ba2eb3045727fc39a49fd9557fb1a1d1
Signed-off-by: default avatarBao Haojun <baohaojun@gmail.com>
parent 32e4479d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment