Changeset 5543


Ignore:
Timestamp:
Nov 9, 2006, 2:50:04 PM (18 years ago)
Author:
Gary Byers
Message:

Use #_ _exit for fatal termination.

Try to run lisp code after #_exit via lazarus(); this is for some
cases of SAVE-APPLICATION (e.g., in the Cocoa GUI).

The environment in which The Undead code runs is a little funky,
especially on PPC. There might be GC implications (cstack will
contain call history as of the point when #_exit called atexit
handlers, vstack & tstack are emptied in lazarus()). We should
barely run any code in this environment, but we will GC a time
or two ...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lisp-kernel/pmcl-kernel.c

    r5336 r5543  
    854854  }
    855855  fprintf(stderr, "Fatal error: %s\n%s\n", param0, param1);
    856   exit(-1);
     856  _exit(-1);
    857857}
    858858
     
    11831183{
    11841184  kill(main_thread_pid, SIGKILL);
    1185   exit(-1);
     1185  _exit(-1);
    11861186}
    11871187
     
    13271327}
    13281328#endif
     1329
     1330void
     1331lazarus()
     1332{
     1333  TCR *tcr = get_tcr(false);
     1334  if (tcr) {
     1335    tcr->vs_area->active = tcr->vs_area->high - node_size;
     1336    tcr->save_vsp = (LispObj *)(tcr->vs_area->active);
     1337    tcr->ts_area->active = tcr->ts_area->high;
     1338    tcr->save_tsp = (LispObj *)(tcr->ts_area->active);
     1339    tcr->catch_top = 0;
     1340    tcr->db_link = 0;
     1341    tcr->xframe = 0;
     1342    start_lisp(tcr, 0);
     1343  }
     1344}
    13291345 
    13301346main(int argc, char *argv[], char *envp[], void *aux)
     
    15261542  egc_control(true, NULL);
    15271543#endif
     1544  atexit(lazarus);
    15281545  start_lisp(TCR_TO_TSD(tcr), 0);
    1529   exit(0);
     1546  _exit(0);
    15301547}
    15311548
Note: See TracChangeset for help on using the changeset viewer.