cros_write_firmware should report proper exit status

When cros_write_firmware fails, it does not report the failure to the
caller (the shell), which makes it impossible to use this utility in
any automation.

This change ensures that the failure status is reported properly.

BUG=chrome-os-partner:15610
TEST=manual
    . while in chroot
    $ dut-control spi1_vref:pp3300
    $ sudo -n cros_write_firmware -b daisy -w usb -d exynos5250-snow -F spi -i /tmp/3604/image-snow.bin -V
    Could not find Exynos board on USB port
    $ echo $?
    1
    $ dut-control spi1_vref:off
    $ sudo -n cros_write_firmware -b daisy -w usb -d exynos5250-snow -F spi -i /tmp/3604/image-snow.bin -V
    $ echo $?
    0
    $

Change-Id: Iab759c954f2de5dcd901d496281b2434eae1cbf2
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42344
Reviewed-by: Simon Glass <sjg@chromium.org>
1 file changed