frecon: fix stdio file descriptors
When frecon runs under busybox based initramfs stdio descriptors do not exist
and epoll and other pts fds created by term alias descriptor numbers 0,1,2.
This change adds a function to create stdio file descriptors using /dev/null
for input and /dev/kmsg for output and uses it to fix stdio descriptiors
of they do not exist. It also reuses this function to create stdio descriptors
for daemon mode since current code using garbage from kmsg for stdin doesn't seem
like a good idea.
BUG=chromium:633514
TEST=run frecon in recovery
Change-Id: I079f106033c3aa71016d728289b80ceeba09db23
Signed-off-by: Dominik Behr <dbehr@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/365261
Commit-Ready: Douglas Anderson <dianders@chromium.org>
3 files changed