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

Skip to content
Commit b9d19c87 authored by Yifan Hong's avatar Yifan Hong
Browse files

lshal: close fd before joining thread

In ~PipeRelay, since the data is no longer needed,
just close the fd before joining the thread.

In previous code, 'lshal debug' can hang:
- lshal read() waiting for data in RelayThread
- lshal send fd to service in main thread
- service close the fd
- service returns in debug() call
- lshal calls ~PipeRelay
- lshal read() is still blocking because it does not
  receive the signal

But, since the service has already end the debug()
call, the fds can be closed to bail out from blocking read().

Test: 'while true; do lshal debug ...; done' does not hang
Fixes: 111997867
Change-Id: I90db486b0a6598bd9998ed904dc0c757dfa57e0e
parent 519485d1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment