Changeset 58898d1d in mainline for uspace/app/taskdump/symtab.c
- Timestamp:
- 2017-03-24T20:31:54Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8e9b2534
- Parents:
- c9e3692
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/taskdump/symtab.c
rc9e3692 r58898d1d 68 68 char *shstrt, *sec_name; 69 69 void *data; 70 aoff64_t pos = 0; 70 71 71 72 int fd; … … 88 89 } 89 90 90 rc = read(fd, & elf_hdr, sizeof(elf_header_t));91 rc = read(fd, &pos, &elf_hdr, sizeof(elf_header_t)); 91 92 if (rc != sizeof(elf_header_t)) { 92 93 printf("failed reading elf header\n"); … … 304 305 { 305 306 int rc; 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)); 307 aoff64_t pos = elf_hdr->e_shoff + idx * sizeof(elf_section_header_t); 308 309 rc = read(fd, &pos, sec_hdr, sizeof(elf_section_header_t)); 313 310 if (rc != sizeof(elf_section_header_t)) 314 311 return EIO; … … 331 328 { 332 329 ssize_t rc; 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 aoff64_t pos = start; 341 331 342 332 *ptr = malloc(size); … … 346 336 } 347 337 348 rc = read(fd, *ptr, size);338 rc = read(fd, &pos, *ptr, size); 349 339 if (rc != (ssize_t) size) { 350 340 printf("failed reading chunk\n");
Note:
See TracChangeset
for help on using the changeset viewer.