Changes in uspace/app/taskdump/symtab.c [ce04ea44:6afc9d7] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskdump/symtab.c
rce04ea44 r6afc9d7 41 41 #include <errno.h> 42 42 #include <sys/types.h> 43 #include <vfs/vfs.h> 43 #include <sys/stat.h> 44 #include <fcntl.h> 44 45 45 46 #include "include/symtab.h" … … 67 68 char *shstrt, *sec_name; 68 69 void *data; 69 aoff64_t pos = 0;70 70 71 71 int fd; … … 81 81 return ENOMEM; 82 82 83 fd = vfs_lookup_open(file_name, WALK_REGULAR, MODE_READ);83 fd = open(file_name, O_RDONLY); 84 84 if (fd < 0) { 85 85 printf("failed opening file\n"); … … 88 88 } 89 89 90 rc = vfs_read(fd, &pos, &elf_hdr, sizeof(elf_header_t));90 rc = read(fd, &elf_hdr, sizeof(elf_header_t)); 91 91 if (rc != sizeof(elf_header_t)) { 92 92 printf("failed reading elf header\n"); … … 165 165 166 166 free(shstrt); 167 vfs_put(fd);167 close(fd); 168 168 169 169 if (stab->sym == NULL || stab->strtab == NULL) { … … 304 304 { 305 305 int rc; 306 aoff64_t pos = elf_hdr->e_shoff + idx * sizeof(elf_section_header_t); 307 308 rc = vfs_read(fd, &pos, sec_hdr, sizeof(elf_section_header_t)); 306 307 rc = lseek(fd, elf_hdr->e_shoff + idx * sizeof(elf_section_header_t), 308 SEEK_SET); 309 if (rc == (off64_t) -1) 310 return EIO; 311 312 rc = read(fd, sec_hdr, sizeof(elf_section_header_t)); 309 313 if (rc != sizeof(elf_section_header_t)) 310 314 return EIO; … … 327 331 { 328 332 ssize_t rc; 329 aoff64_t pos = start; 333 off64_t offs; 334 335 offs = lseek(fd, start, SEEK_SET); 336 if (offs == (off64_t) -1) { 337 printf("failed seeking chunk\n"); 338 *ptr = NULL; 339 return EIO; 340 } 330 341 331 342 *ptr = malloc(size); … … 335 346 } 336 347 337 rc = vfs_read(fd, &pos, *ptr, size);348 rc = read(fd, *ptr, size); 338 349 if (rc != (ssize_t) size) { 339 350 printf("failed reading chunk\n");
Note:
See TracChangeset
for help on using the changeset viewer.