commit | 6a8f2e32835ad110cd6a2f510832f4ac16857782 | [log] [tgz] |
---|---|---|
author | Nick Kralevich <nnk@google.com> | Sat Dec 10 12:17:32 2016 -0800 |
committer | Nick Kralevich <nnk@google.com> | Sat Dec 10 12:20:11 2016 -0800 |
tree | 65cdfce9607c479d6f4e5a988030048c8d2ec70b | |
parent | beddc5735a5d64a6a668f331a86e366ef5f1913d [diff] |
init/service.cpp: fix FD leak for services with consoles When init starts a service with a console, it tests for the presence of a readable/writable console device. The test results in a leaked file descriptor. Use access() instead of open() to avoid leaking file descriptors. Bug introduced in 70daa67062c016eea1a30be2e1de0dcba1d23a13. Test: compiles and device boots Change-Id: I4efcfa0bb2cdb09f0455bc04a3a91e784bda7962