Mercurial > flash_v2
comparison packages/fs/jffs2/current/tests/fileio1.c @ 1443:cd7d2afbc7dd
Import latest JFFS2 code from David Woodhouse
| author | gthomas |
|---|---|
| date | Thu, 11 Dec 2003 23:33:54 +0000 |
| parents | d2c90368aeef |
| children | 99834d6b6eeb |
comparison
equal
deleted
inserted
replaced
| 1442:b2f2e3f2a047 | 1443:cd7d2afbc7dd |
|---|---|
| 95 #define SHOW_RESULT( _fn, _res ) \ | 95 #define SHOW_RESULT( _fn, _res ) \ |
| 96 diag_printf("<FAIL>: " #_fn "() returned %d %s\n", _res, _res<0?strerror(errno):""); | 96 diag_printf("<FAIL>: " #_fn "() returned %d %s\n", _res, _res<0?strerror(errno):""); |
| 97 | 97 |
| 98 //========================================================================== | 98 //========================================================================== |
| 99 | 99 |
| 100 #define IOSIZE 100 | 100 #define IOSIZE 1000 |
| 101 | 101 |
| 102 #define LONGNAME1 "long_file_name_that_should_take_up_more_than_one_directory_entry_1" | 102 #define LONGNAME1 "long_file_name_that_should_take_up_more_than_one_directory_entry_1" |
| 103 #define LONGNAME2 "long_file_name_that_should_take_up_more_than_one_directory_entry_2" | 103 #define LONGNAME2 "long_file_name_that_should_take_up_more_than_one_directory_entry_2" |
| 104 | 104 |
| 105 | 105 |
| 180 | 180 |
| 181 //========================================================================== | 181 //========================================================================== |
| 182 | 182 |
| 183 static void createfile( char *name, size_t size ) | 183 static void createfile( char *name, size_t size ) |
| 184 { | 184 { |
| 185 char buf[IOSIZE]; | 185 unsigned char buf[IOSIZE]; |
| 186 int fd; | 186 int fd; |
| 187 ssize_t wrote; | 187 ssize_t wrote; |
| 188 int i; | 188 int i; |
| 189 int err; | 189 int err; |
| 190 | 190 |
| 253 | 253 |
| 254 //========================================================================== | 254 //========================================================================== |
| 255 | 255 |
| 256 static void checkfile( char *name ) | 256 static void checkfile( char *name ) |
| 257 { | 257 { |
| 258 char buf[IOSIZE]; | 258 unsigned char buf[IOSIZE]; |
| 259 int fd; | 259 int fd; |
| 260 ssize_t done; | 260 ssize_t done; |
| 261 int i; | 261 int i; |
| 262 int err; | 262 int err; |
| 263 off_t pos = 0; | 263 off_t pos = 0; |
