Revision fb7e378c linux-user/mmap.c

b/linux-user/mmap.c
250 250
            mprotect(host_start, qemu_host_page_size, prot1 | PROT_WRITE);
251 251

  
252 252
        /* read the corresponding file data */
253
        pread(fd, g2h(start), end - start, offset);
253
        if (pread(fd, g2h(start), end - start, offset) == -1)
254
            return -1;
254 255

  
255 256
        /* put final protection */
256 257
        if (prot_new != (prot1 | PROT_WRITE))
......
474 475
                                  -1, 0);
475 476
            if (retaddr == -1)
476 477
                goto fail;
477
            pread(fd, g2h(start), len, offset);
478
            if (pread(fd, g2h(start), len, offset) == -1)
479
                goto fail;
478 480
            if (!(prot & PROT_WRITE)) {
479 481
                ret = target_mprotect(start, len, prot);
480 482
                if (ret != 0) {

Also available in: Unified diff