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
This commit is contained in:
parent
8a21372e5b
commit
79642ea634
2 changed files with 7 additions and 2 deletions
|
@ -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:
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue