diff --git a/firmware/common/file.c b/firmware/common/file.c index f7cc02a..46e3d56 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c @@ -57,7 +57,7 @@ static int flush_cache(int fd); int file_creat(const char *pathname) { - return open(pathname, O_WRONLY|O_CREAT|O_TRUNC, 0666); + return file_open(pathname, O_WRONLY|O_CREAT|O_TRUNC/*, 0666*/); } static int open_internal_part(const char* pathname, int flags, bool use_cache, @@ -357,7 +357,7 @@ int rename(const char* path, const char* newpath) /* verify new path does not already exist */ /* If it is a directory, errno == EISDIR if the name exists */ - fd = open(newpath, O_RDONLY); + fd = file_open(newpath, O_RDONLY); if ( fd >= 0 || errno == EISDIR) { close(fd); errno = EBUSY; diff --git a/firmware/export/system.h b/firmware/export/system.h index d93d10c..b507f10 100644 --- a/firmware/export/system.h +++ b/firmware/export/system.h @@ -192,7 +192,7 @@ enum { #include "system-sdl.h" #define NEED_GENERIC_BYTESWAPS #elif defined(__PCTOOL__) -#include "system-sdl.h" +//#include "system-sdl.h" #define NEED_GENERIC_BYTESWAPS #endif #include "bitswap.h" diff --git a/firmware/test/fat/main.c b/firmware/test/fat/main.c index fb3193c..b4ac2a4 100644 --- a/firmware/test/fat/main.c +++ b/firmware/test/fat/main.c @@ -114,9 +114,9 @@ int dbg_mkfile(char* name, int num) int x=0; bool stop = false; - fd = creat(name,O_WRONLY); + fd = file_creat(name/*,O_WRONLY*/); if (fd<0) { - DEBUGF("Failed creating file\n"); + printf("Failed creating file %s\n", name); return -1; } num *= 1024; @@ -129,16 +129,16 @@ int dbg_mkfile(char* name, int num) rc = write(fd, text, len); if ( rc < 0 ) { - DEBUGF("Failed writing data\n"); + printf("Failed writing data\n"); return -1; } else if ( rc == 0 ) { - DEBUGF("No space left\n"); + printf("No space left\n"); return -2; } else - DEBUGF("wrote %d bytes\n",rc); + printf("wrote %d bytes\n",rc); num -= len; @@ -148,7 +148,7 @@ int dbg_mkfile(char* name, int num) /* add a random number of chunks to test byte-copy code */ num = ((int) rand() % SECTOR_SIZE) & ~7; - LDEBUGF("Adding random size %d\n",num); + printf("Adding random size %d\n",num); stop = true; } } @@ -164,7 +164,7 @@ int dbg_chkfile(char* name, int size) int x=0; int pos = 0; int block=0; - int fd = open(name,O_RDONLY); + int fd = file_open(name,O_RDONLY); if (fd<0) { DEBUGF("Failed opening file\n"); return -1;