Changeset 10819


Ignore:
Timestamp:
Sep 22, 2008, 12:04:27 PM (11 years ago)
Author:
gb
Message:

drop old Darwin bug workaround, involving write_area_pages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/image.c

    r10718 r10819  
    346346}
    347347
    348 OSErr
    349 write_area_pages(int fd, area *a)
    350 {
    351   natural total = a->active - a->low, count, done=0;
    352   signed_natural n;
    353   char buffer[32768];
    354 
    355   while (total) {
    356     if (total > 32768) {
    357       count = 32768;
    358     } else {
    359       count = total;
    360     }
    361     memmove(buffer,a->low+done,count);
    362     n = write(fd, buffer, count);
    363     if (n < 0) {
    364       return n;
    365     }
    366     total -= n;
    367     done += n;
    368   }
    369   return 0;
    370 }
    371348 
    372349
     
    479456    n = sections[i].memory_size;
    480457    nstatic = sections[i].static_dnodes;
    481     if (a->code == AREA_READONLY) {
    482       /*
    483          Darwin seems to have problems writing the readonly area for
    484          some reason.  It seems to work better to write a page at a
    485          time.
    486       */
    487       if (write_area_pages(fd, a) != 0) {
     458    if (write(fd, a->low, n) != n) {
    488459        return errno;
    489       }
    490     } else {
    491       if (write(fd, a->low, n) != n) {
    492         return errno;
    493       }
    494460    }
    495461  }
Note: See TracChangeset for help on using the changeset viewer.