mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 13:49:17 +02:00
Fix
This commit is contained in:
parent
f41a61f748
commit
0673eae46d
5 changed files with 31 additions and 24 deletions
|
@ -1,20 +1,29 @@
|
||||||
|
(define unwind #f)
|
||||||
|
|
||||||
|
((call/cc
|
||||||
|
(lambda (k)
|
||||||
|
(set! unwind k)
|
||||||
|
(lambda () #f))))
|
||||||
|
|
||||||
(cond-expand
|
(cond-expand
|
||||||
(plan9
|
(plan9
|
||||||
(define (exit . o)
|
(define (emergency-exit . o)
|
||||||
(%exit (if (pair? o)
|
(%exit (if (pair? o)
|
||||||
(if (string? (car o))
|
(if (string? (car o))
|
||||||
(car o)
|
(car o)
|
||||||
(if (eq? #t (car o)) "" "chibi error"))
|
(if (eq? #t (car o)) "" "chibi error"))
|
||||||
""))))
|
""))))
|
||||||
(else
|
(else
|
||||||
(define (exit . o)
|
(define (emergency-exit . o)
|
||||||
(%exit (if (pair? o)
|
(%exit (if (pair? o)
|
||||||
(if (integer? (car o))
|
(if (integer? (car o))
|
||||||
(inexact->exact (car o))
|
(inexact->exact (car o))
|
||||||
(if (eq? #t (car o)) 0 1))
|
(if (eq? #t (car o)) 0 1))
|
||||||
0)))))
|
0)))))
|
||||||
|
|
||||||
|
(define (exit . o)
|
||||||
|
(unwind (lambda () (apply emergency-exit o))))
|
||||||
|
|
||||||
(cond-expand
|
(cond-expand
|
||||||
(bsd
|
(bsd
|
||||||
(define (process-command-line pid)
|
(define (process-command-line pid)
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
|
|
||||||
(define-library (chibi process)
|
(define-library (chibi process)
|
||||||
(export exit sleep alarm %fork fork kill execute waitpid system system?
|
(export exit emergency-exit sleep alarm
|
||||||
|
%fork fork kill execute waitpid system system?
|
||||||
process-command-line process-running?
|
process-command-line process-running?
|
||||||
set-signal-action! make-signal-set
|
set-signal-action! make-signal-set
|
||||||
signal-set? signal-set-contains?
|
signal-set? signal-set-contains?
|
||||||
|
|
|
@ -1,7 +1,17 @@
|
||||||
(define (exit . code?)
|
(define unwind #f)
|
||||||
|
|
||||||
|
((call/cc
|
||||||
|
(lambda (k)
|
||||||
|
(set! unwind k)
|
||||||
|
(lambda () #f))))
|
||||||
|
|
||||||
|
(define (emergency-exit . code?)
|
||||||
(%exit (if (pair? code?)
|
(%exit (if (pair? code?)
|
||||||
(let ((c (car code?)))
|
(let ((c (car code?)))
|
||||||
(cond ((integer? c) c)
|
(cond ((integer? c) c)
|
||||||
((eq? #t c) 0)
|
((eq? #t c) 0)
|
||||||
(else 1)))
|
(else 1)))
|
||||||
0)))
|
0)))
|
||||||
|
|
||||||
|
(define (exit . o)
|
||||||
|
(unwind (lambda () (apply emergency-exit o))))
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
(define-library (chibi win32 process-win32)
|
(define-library (chibi win32 process-win32)
|
||||||
(import (scheme base))
|
(import (scheme base))
|
||||||
(export exit)
|
(export exit emergency-exit)
|
||||||
(cond-expand
|
(cond-expand
|
||||||
(windows
|
(windows
|
||||||
(include-shared "process-win32")
|
(include-shared "process-win32")
|
||||||
(include "process-win32.scm"))
|
(include "process-win32.scm"))
|
||||||
(else
|
(else
|
||||||
(import (only (chibi process) exit)))))
|
(import (only (chibi process) exit emergency-exit)))))
|
||||||
|
|
|
@ -1,20 +1,7 @@
|
||||||
|
|
||||||
(define-library (scheme process-context)
|
(define-library (scheme process-context)
|
||||||
(import (chibi) (only (scheme base) call/cc) (srfi 98))
|
(import (chibi) (srfi 98))
|
||||||
(cond-expand (windows (import (prefix (only (chibi win32 process-win32) exit) process-)))
|
(cond-expand (windows (import (only (chibi win32 process-win32) exit emergency-exit)))
|
||||||
(else (import (prefix (only (chibi process) exit) process-))))
|
(else (import (only (chibi process) exit emergency-exit))))
|
||||||
(export get-environment-variable get-environment-variables
|
(export get-environment-variable get-environment-variables
|
||||||
command-line exit emergency-exit)
|
command-line exit emergency-exit))
|
||||||
|
|
||||||
(begin
|
|
||||||
(define unwind #f)
|
|
||||||
|
|
||||||
((call/cc
|
|
||||||
(lambda (cont)
|
|
||||||
(set! unwind cont)
|
|
||||||
(lambda () #f))))
|
|
||||||
|
|
||||||
(define emergency-exit process-exit)
|
|
||||||
|
|
||||||
(define (exit . rest)
|
|
||||||
(unwind (lambda () (apply emergency-exit rest))))))
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue