kinect_upload_fw: print more meaningful error message on failure
authorAntonio Ospite <ospite@studenti.unina.it>
Fri, 30 Sep 2011 11:38:42 +0000 (13:38 +0200)
committerAntonio Ospite <ospite@studenti.unina.it>
Fri, 30 Sep 2011 11:38:42 +0000 (13:38 +0200)
kinect_upload_fw/kinect_upload_fw.c

index 51ef81e..36532fa 100644 (file)
@@ -32,6 +32,7 @@
 #include <stdio.h>
 #include <unistd.h>
 #include <stdlib.h>
+#include <string.h>
 #include <errno.h>
 #include <libusb.h>
 
@@ -128,7 +129,7 @@ int main(int argc, char** argv) {
        }
        FILE* fw = fopen(filename, "r");
        if(fw == NULL) {
-               fprintf(stderr, "Failed to open %s: error %d", filename, errno);
+               fprintf(stderr, "Failed to open %s: %s\n", filename, strerror(errno));
                return errno;
        }