summaryrefslogtreecommitdiffstats
path: root/utils/meizu_dfu/meizu_dfu.c
diff options
context:
space:
mode:
authorBertrik Sikken <bertrik@sikken.nl>2009-06-28 09:52:24 +0000
committerBertrik Sikken <bertrik@sikken.nl>2009-06-28 09:52:24 +0000
commit79642ea634c34e599fe21935ea0817059d2c488a (patch)
treec6018ed6803098d4211e1a5d303e3ec65da9775f /utils/meizu_dfu/meizu_dfu.c
parent8a21372e5bcfddabac0aa05b9dd9e3dc5e85da9b (diff)
downloadrockbox-79642ea634c34e599fe21935ea0817059d2c488a.tar.gz
rockbox-79642ea634c34e599fe21935ea0817059d2c488a.tar.bz2
rockbox-79642ea634c34e599fe21935ea0817059d2c488a.zip
meizu_dfu:
1) add check on existance of file to be flashed 2) enable compiler warnings in Makefile 3) fix compiler warning about htonl (etc.) git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21538 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/meizu_dfu/meizu_dfu.c')
-rw-r--r--utils/meizu_dfu/meizu_dfu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/meizu_dfu/meizu_dfu.c b/utils/meizu_dfu/meizu_dfu.c
index 0e32ea8d35..1658c4d1e8 100644
--- a/utils/meizu_dfu/meizu_dfu.c
+++ b/utils/meizu_dfu/meizu_dfu.c
@@ -27,6 +27,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <libgen.h>
+#include <arpa/inet.h>
#include <usb.h>
@@ -110,7 +111,10 @@ void init_img(image_data_t *img, const char *filename, image_attr_t *attr)
printf("Reading %s...", filename);
- stat(filename, &statbuf);
+ if (stat(filename, &statbuf) < 0) {
+ printf("\nCould not stat file, exiting.\n");
+ exit(1);
+ }
len = statbuf.st_size;
img->name = basename(strdup(filename));