Changes in uspace/app/taskdump/symtab.c [125c09c:8d2dd7f2] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskdump/symtab.c
r125c09c r8d2dd7f2 41 41 #include <stddef.h> 42 42 #include <errno.h> 43 #include <str_error.h>44 43 #include <vfs/vfs.h> 45 44 … … 72 71 int fd; 73 72 int rc; 74 size_t nread;75 73 int i; 76 74 … … 83 81 return ENOMEM; 84 82 85 rc = vfs_lookup_open(file_name, WALK_REGULAR, MODE_READ, &fd);86 if ( rc != EOK) {87 printf("failed opening file '%s': %s\n", file_name, str_error(rc));83 fd = vfs_lookup_open(file_name, WALK_REGULAR, MODE_READ); 84 if (fd < 0) { 85 printf("failed opening file\n"); 88 86 free(stab); 89 87 return ENOENT; 90 88 } 91 89 92 rc = vfs_read(fd, &pos, &elf_hdr, sizeof(elf_header_t) , &nread);93 if (rc != EOK || nread !=sizeof(elf_header_t)) {90 rc = vfs_read(fd, &pos, &elf_hdr, sizeof(elf_header_t)); 91 if (rc != sizeof(elf_header_t)) { 94 92 printf("failed reading elf header\n"); 95 93 free(stab); … … 306 304 { 307 305 int rc; 308 size_t nread;309 306 aoff64_t pos = elf_hdr->e_shoff + idx * sizeof(elf_section_header_t); 310 307 311 rc = vfs_read(fd, &pos, sec_hdr, sizeof(elf_section_header_t) , &nread);312 if (rc != EOK || nread !=sizeof(elf_section_header_t))308 rc = vfs_read(fd, &pos, sec_hdr, sizeof(elf_section_header_t)); 309 if (rc != sizeof(elf_section_header_t)) 313 310 return EIO; 314 311 … … 329 326 static int chunk_load(int fd, off64_t start, size_t size, void **ptr) 330 327 { 331 int rc; 332 size_t nread; 328 ssize_t rc; 333 329 aoff64_t pos = start; 334 330 … … 339 335 } 340 336 341 rc = vfs_read(fd, &pos, *ptr, size , &nread);342 if (rc != EOK || nread !=size) {337 rc = vfs_read(fd, &pos, *ptr, size); 338 if (rc != (ssize_t) size) { 343 339 printf("failed reading chunk\n"); 344 340 free(*ptr);
Note:
See TracChangeset
for help on using the changeset viewer.