diff options
| author | Bertrik Sikken <bertrik@sikken.nl> | 2009-06-28 09:52:24 +0000 |
|---|---|---|
| committer | Bertrik Sikken <bertrik@sikken.nl> | 2009-06-28 09:52:24 +0000 |
| commit | 79642ea634c34e599fe21935ea0817059d2c488a (patch) | |
| tree | c6018ed6803098d4211e1a5d303e3ec65da9775f /utils | |
| parent | 8a21372e5bcfddabac0aa05b9dd9e3dc5e85da9b (diff) | |
| download | rockbox-79642ea634c34e599fe21935ea0817059d2c488a.zip rockbox-79642ea634c34e599fe21935ea0817059d2c488a.tar.gz rockbox-79642ea634c34e599fe21935ea0817059d2c488a.tar.bz2 rockbox-79642ea634c34e599fe21935ea0817059d2c488a.tar.xz | |
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')
| -rw-r--r-- | utils/meizu_dfu/Makefile | 3 | ||||
| -rw-r--r-- | utils/meizu_dfu/meizu_dfu.c | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/utils/meizu_dfu/Makefile b/utils/meizu_dfu/Makefile index 6b368fa..fdd765d 100644 --- a/utils/meizu_dfu/Makefile +++ b/utils/meizu_dfu/Makefile @@ -1,8 +1,9 @@ +CFLAGS = -W -Wall +LDFLAGS = -lusb all: meizu_dfu meizu_dfu: meizu_dfu.c - gcc -o meizu_dfu meizu_dfu.c -lusb .PHONY: clean clean: diff --git a/utils/meizu_dfu/meizu_dfu.c b/utils/meizu_dfu/meizu_dfu.c index 0e32ea8..1658c4d 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)); |