Changeset 7a819535 in mainline
- Timestamp:
 - 2011-06-12T05:29:50Z (14 years ago)
 - Branches:
 - lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
 - Children:
 - b12edd1
 - Parents:
 - 52ee8b7a
 - Location:
 - uspace
 - Files:
 - 
      
- 3 edited
 
- 
          
  app/filegen/Makefile (modified) (1 diff)
 - 
          
  app/filegen/filegen.c (modified) (2 diffs)
 - 
          
  srv/fs/fat/fat_directory.c (modified) (1 diff)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
uspace/app/filegen/Makefile
r52ee8b7a r7a819535 32 32 33 33 SOURCES = \ 34 filegen.c 34 filegen.c \ 35 crc32.c 35 36 36 37 include $(USPACE_PREFIX)/Makefile.common  - 
      
uspace/app/filegen/filegen.c
r52ee8b7a r7a819535 18 18 #include <errno.h> 19 19 #include <sys/time.h> 20 #include "crc32.h" 20 21 21 22 #define NAME "filegen" 22 23 #define VERSION "0.0.1" 24 25 #define BUFFERSIZE 256 26 23 27 24 28 static void print_help(void); … … 46 50 } 47 51 48 size = size / sizeof(int);49 50 52 struct timeval tv; 51 53 gettimeofday(&tv, NULL); 52 54 srandom(tv.tv_sec + tv.tv_usec / 100000); 53 55 54 uint32_t i; 55 int dword=0; 56 for (i = 0; i<size; i++) { 57 dword = rand(); 58 write(fd, &dword, sizeof(int)); 56 uint64_t i=0, pbuf=0; 57 uint32_t crc=~0; 58 char buf[BUFFERSIZE]; 59 60 while (i<size) { 61 pbuf=0; 62 while (i<size && pbuf<BUFFERSIZE) { 63 buf[pbuf] = rand() % 255; 64 i++; 65 pbuf++; 66 } 67 if (pbuf) { 68 crc32(buf, pbuf, &crc); 69 write(fd, buf, pbuf); 70 } 59 71 } 60 72 61 73 close(fd); 74 crc = ~crc; 75 printf("%s: %x\n", argv[1], crc); 62 76 63 77 return 0;  - 
      
uspace/srv/fs/fat/fat_directory.c
r52ee8b7a r7a819535 88 88 rc = fat_block_get(&di->b, di->bs, di->nodep, i, BLOCK_FLAGS_NONE); 89 89 if (rc != EOK) { 90 di->b = NULL :90 di->b = NULL; 91 91 return rc; 92 92 }  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  