fastboot should return non-zero exit code on error

When using fastboot in scripts, it currently is necessary to parse the
output for FAILED messages and possible other indications of
error. This happens relatively often, for example when there are radio
update issues. Fortunately, fb_execute_queue already has a notion that
an error has occured which is used to abort the queue execution.

This change makes the status value be returned from fb_execute_queue
to main which can then return it as an exit status. usage cases were
also changed to return 1.

Note the code already returned 1 for error in one other case when
there was a problem with boot, so there is a precedent for return 1 on
error in this program.

Change-Id: Ib0463b08c8f2569495e248dd84e331f7e3691039
diff --git a/fastboot/fastboot.c b/fastboot/fastboot.c
index bed30b2..5389351 100644
--- a/fastboot/fastboot.c
+++ b/fastboot/fastboot.c
@@ -550,11 +550,12 @@
     void *data;
     unsigned sz;
     unsigned page_size = 2048;
+    int status;
 
     skip(1);
     if (argc == 0) {
         usage();
-        return 0;
+        return 1;
     }
 
     if (!strcmp(*argv, "devices")) {
@@ -686,6 +687,7 @@
             argc = do_oem_command(argc, argv);
         } else {
             usage();
+	    return 1;
         }
     }
 
@@ -701,6 +703,6 @@
 
     usb = open_device();
 
-    fb_execute_queue(usb);
-    return 0;
+    status = fb_execute_queue(usb);
+    return (status) ? 1 : 0;
 }