mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 08:25:38 +00:00
parent
e1435a3f57
commit
69ec6f5dd8
@ -4,10 +4,11 @@
|
||||
|
||||
INC_DIR += $(REP_DIR)/src/lib/ffat/contrib
|
||||
|
||||
SRC_C = ff.c
|
||||
SRC_C = ff.c ccsbcs.c
|
||||
SRC_CC = diskio_block.cc
|
||||
|
||||
LIBS = signal
|
||||
|
||||
vpath % $(REP_DIR)/contrib/ff007e/src
|
||||
vpath % $(REP_DIR)/src/lib/ffat/
|
||||
vpath % $(REP_DIR)/contrib/ff007e/src
|
||||
vpath % $(REP_DIR)/contrib/ff007e/src/option
|
||||
|
@ -1,6 +1,6 @@
|
||||
diff --git a/src/ffconf.h b/src/ffconf.h
|
||||
--- a/src/ffconf.h
|
||||
+++ b/src/ffconf.h
|
||||
diff -urN ff007e.orig/src/ffconf.h ff007e/src/ffconf.h
|
||||
--- ff007e.orig/src/ffconf.h 2009-11-03 00:44:22.000000000 +0100
|
||||
+++ ff007e/src/ffconf.h 2012-07-09 13:08:03.000000000 +0200
|
||||
@@ -40,7 +40,7 @@
|
||||
/* To enable string functions, set _USE_STRFUNC to 1 or 2. */
|
||||
|
||||
@ -19,6 +19,15 @@ diff --git a/src/ffconf.h b/src/ffconf.h
|
||||
/* The _CODE_PAGE specifies the OEM code page to be used on the target system.
|
||||
/ Incorrect setting of the code page can cause a file open failure.
|
||||
/
|
||||
@@ -86,7 +86,7 @@
|
||||
*/
|
||||
|
||||
|
||||
-#define _USE_LFN 0 /* 0, 1 or 2 */
|
||||
+#define _USE_LFN 1 /* 0, 1 or 2 */
|
||||
#define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */
|
||||
/* The _USE_LFN option switches the LFN support.
|
||||
/
|
||||
@@ -105,7 +105,7 @@
|
||||
*/
|
||||
|
||||
|
@ -320,9 +320,10 @@ class Plugin : public Libc::Plugin
|
||||
::memset(dirent, 0, sizeof(struct dirent));
|
||||
|
||||
FILINFO ffat_file_info;
|
||||
FRESULT res;
|
||||
ffat_file_info.lfname = dirent->d_name;
|
||||
ffat_file_info.lfsize = sizeof(dirent->d_name);
|
||||
|
||||
res = f_readdir(_get_ffat_dir(fd), &ffat_file_info);
|
||||
FRESULT res = f_readdir(_get_ffat_dir(fd), &ffat_file_info);
|
||||
switch(res) {
|
||||
case FR_OK:
|
||||
break;
|
||||
@ -354,8 +355,9 @@ class Plugin : public Libc::Plugin
|
||||
|
||||
dirent->d_reclen = sizeof(struct dirent);
|
||||
|
||||
::strncpy(dirent->d_name, ffat_file_info.fname,
|
||||
sizeof(dirent->d_name));
|
||||
if (dirent->d_name[0] == 0) /* use short file name */
|
||||
::strncpy(dirent->d_name, ffat_file_info.fname,
|
||||
sizeof(dirent->d_name));
|
||||
|
||||
dirent->d_namlen = ::strlen(dirent->d_name);
|
||||
|
||||
@ -587,6 +589,9 @@ class Plugin : public Libc::Plugin
|
||||
using namespace Ffat;
|
||||
|
||||
FILINFO file_info;
|
||||
/* the long file name is not used in this function */
|
||||
file_info.lfname = 0;
|
||||
file_info.lfsize = 0;
|
||||
|
||||
FRESULT res = f_stat(path, &file_info);
|
||||
|
||||
|
@ -23,8 +23,8 @@
|
||||
|
||||
|
||||
#define CALL_AND_CHECK(ret, operation, condition, info_string, ...) \
|
||||
ret = operation; \
|
||||
printf("calling " #operation " " info_string "\n", ##__VA_ARGS__); \
|
||||
ret = operation; \
|
||||
if (condition) { \
|
||||
printf(#operation " succeeded\n"); \
|
||||
} else { \
|
||||
@ -37,16 +37,20 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
int ret, fd;
|
||||
|
||||
char const *dir_name = "/testdir";
|
||||
char const *file_name = "test.tst";
|
||||
char const *pattern = "a single line of text";
|
||||
char const *dir_name = "/testdir";
|
||||
char const *dir_name_long = "testdir long";
|
||||
char const *file_name = "test.tst";
|
||||
char const *pattern = "a single line of text";
|
||||
|
||||
/* create directory */
|
||||
/* create directory (short name) */
|
||||
CALL_AND_CHECK(ret, mkdir(dir_name, 0777), ret == 0, "dir_name=%s", dir_name);
|
||||
|
||||
/* change to new directory */
|
||||
CALL_AND_CHECK(ret, chdir(dir_name), ret == 0, "dir_name=%s", dir_name);
|
||||
|
||||
/* create directory (long name) */
|
||||
CALL_AND_CHECK(ret, mkdir(dir_name_long, 0777), ret == 0, "dir_name_long=%s", dir_name_long);
|
||||
|
||||
/* write pattern to a file */
|
||||
CALL_AND_CHECK(fd, open(file_name, O_CREAT | O_WRONLY), fd >= 0, "file_name=%s", file_name);
|
||||
size_t count = strlen(pattern);
|
||||
|
Loading…
x
Reference in New Issue
Block a user