Many MTK devices have bootloader connection available only for few seconds
after power-up. To not try to synchronize all of device connection over USB/
power-on and fernly-usb-loader start up, the latter can be run in this "wait"
mode, and a device connected and bootloader start at leisure.
To interactively communicate with the fernly loader, pass '-s' to the
fernly-usb-loader program. Otherwise it will wait for the shell to
start and then exit.
Signed-off-by: Sean Cross <xobs@kosagi.com>
Use the macros STDIN_FILENO and STDOUT_FILENO to refer to the file
handles for stdin and stdout. This prevents us from using the wrong handle
to write or read, which was a problem with the older code.
Signed-off-by: Sean Cross <xobs@kosagi.com>