Changeset 8790


Ignore:
Timestamp:
Mar 15, 2008, 8:51:53 AM (12 years ago)
Author:
gb
Message:

Trust read() return value, now that image file is opened with O_BINARY
set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/win64/lisp-kernel/memory.c

    r8784 r8790  
    371371  lseek(fd, pos, SEEK_SET);
    372372
    373   //  while (total < nbytes) {
     373  while (total < nbytes) {
    374374    count = read(fd, addr + total, nbytes - total);
    375     //   total += count;
    376     //fprintf(stderr, "read %Id bytes, for a total of %Id out of %Id so far\n", count, total, nbytes);
    377     //if (!(count > 0))
    378     // return false;
    379     //}
     375    total += count;
     376    // fprintf(stderr, "read %Id bytes, for a total of %Id out of %Id so far\n", count, total, nbytes);
     377    if (!(count > 0))
     378      return false;
     379  }
    380380
    381381  lseek(fd, opos, SEEK_SET);
Note: See TracChangeset for help on using the changeset viewer.