Changes in uspace/app/tester/mm/pager1.c [ce04ea44:e755b3f] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/mm/pager1.c
rce04ea44 re755b3f 28 28 29 29 #include <stdio.h> 30 #include <vfs/vfs.h> 30 #include <unistd.h> 31 #include <fcntl.h> 31 32 #include <stdlib.h> 32 33 #include <malloc.h> … … 47 48 TPRINTF("Creating temporary file...\n"); 48 49 49 fd = vfs_lookup_open(TEST_FILE, WALK_REGULAR | WALK_MAY_CREATE, 50 MODE_READ | MODE_WRITE); 50 fd = open(TEST_FILE, O_CREAT); 51 51 if (fd < 0) 52 52 return NULL; 53 (void) vfs_unlink_path(TEST_FILE); 54 55 if (vfs_write(fd, (aoff64_t []) {0}, text, sizeof(text)) < 0) { 56 vfs_put(fd); 53 (void) unlink(TEST_FILE); 54 if (write(fd, text, sizeof(text)) != sizeof(text)) { 55 close(fd); 57 56 return NULL; 58 57 } … … 65 64 66 65 if (!vfs_pager_sess) { 67 vfs_put(fd);66 close(fd); 68 67 return NULL; 69 68 } … … 74 73 AS_AREA_READ | AS_AREA_CACHEABLE, vfs_pager_sess, fd, 0, 0); 75 74 if (result == AS_MAP_FAILED) { 76 vfs_put(fd);75 close(fd); 77 76 return NULL; 78 77 } … … 102 101 103 102 as_area_destroy(buffer); 104 vfs_put(fd);103 close(fd); 105 104 106 105 return NULL;
Note:
See TracChangeset
for help on using the changeset viewer.