Changeset 58898d1d in mainline for uspace/app/taskdump/symtab.c


Ignore:
Timestamp:
2017-03-24T20:31:54Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8e9b2534
Parents:
c9e3692
Message:

Remove VFS_IN_SEEK from VFS

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/taskdump/symtab.c

    rc9e3692 r58898d1d  
    6868        char *shstrt, *sec_name;
    6969        void *data;
     70        aoff64_t pos = 0;
    7071
    7172        int fd;
     
    8889        }
    8990
    90         rc = read(fd, &elf_hdr, sizeof(elf_header_t));
     91        rc = read(fd, &pos, &elf_hdr, sizeof(elf_header_t));
    9192        if (rc != sizeof(elf_header_t)) {
    9293                printf("failed reading elf header\n");
     
    304305{
    305306        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));
    313310        if (rc != sizeof(elf_section_header_t))
    314311                return EIO;
     
    331328{
    332329        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;
    341331
    342332        *ptr = malloc(size);
     
    346336        }
    347337
    348         rc = read(fd, *ptr, size);
     338        rc = read(fd, &pos, *ptr, size);
    349339        if (rc != (ssize_t) size) {
    350340                printf("failed reading chunk\n");
Note: See TracChangeset for help on using the changeset viewer.