Changeset 8e3498b in mainline for uspace/app/tester
- Timestamp:
- 2017-12-04T18:44:24Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bde5c04
- Parents:
- 40feeac
- Location:
- uspace/app/tester
- Files:
-
- 2 edited
-
mm/pager1.c (modified) (2 diffs)
-
vfs/vfs1.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/mm/pager1.c
r40feeac r8e3498b 44 44 static void *create_paged_area(size_t size) 45 45 { 46 size_t nwr; 47 int rc; 48 46 49 TPRINTF("Creating temporary file...\n"); 47 50 … … 52 55 (void) vfs_unlink_path(TEST_FILE); 53 56 54 if (vfs_write(fd, (aoff64_t []) {0}, text, sizeof(text)) < 0) { 57 rc = vfs_write(fd, (aoff64_t []) {0}, text, sizeof(text), &nwr); 58 if (rc != EOK) { 55 59 vfs_put(fd); 56 60 return NULL; -
uspace/app/tester/vfs/vfs1.c
r40feeac r8e3498b 84 84 85 85 size_t size = sizeof(text); 86 ssize_t cnt = vfs_write(fd0, &pos, text, size); 87 if (cnt < 0) 86 size_t cnt; 87 rc = vfs_write(fd0, &pos, text, size, &cnt); 88 if (rc != EOK) 88 89 return "write() failed"; 89 90 TPRINTF("Written %zd bytes\n", cnt); … … 93 94 char buf[BUF_SIZE]; 94 95 TPRINTF("read..\n"); 95 while (( cnt = vfs_read(fd0, &pos, buf, BUF_SIZE))) {96 TPRINTF("read returns %zd\n", cnt);97 if ( cnt < 0)96 while ((rc = vfs_read(fd0, &pos, buf, BUF_SIZE, &cnt))) { 97 TPRINTF("read returns rc = %d, cnt = %zu\n", rc, cnt); 98 if (rc != EOK) 98 99 return "read() failed"; 99 100 100 int _cnt = (int) cnt;101 if ( _cnt != cnt) {101 int icnt = (int) cnt; 102 if ((size_t) icnt != cnt) { 102 103 /* Count overflow, just to be sure. */ 103 104 TPRINTF("Read %zd bytes\n", cnt); 104 105 } else { 105 TPRINTF("Read %zd bytes: \"%.*s\"\n", cnt, _cnt, buf);106 TPRINTF("Read %zd bytes: \"%.*s\"\n", cnt, icnt, buf); 106 107 } 107 108 }
Note:
See TracChangeset
for help on using the changeset viewer.
