Added hook to align cwd and umask for the S48 system.
This commit is contained in:
parent
6643c70391
commit
284d89fe12
|
@ -154,7 +154,9 @@
|
||||||
output-channel?
|
output-channel?
|
||||||
open-output-channel
|
open-output-channel
|
||||||
channel-write
|
channel-write
|
||||||
close-output-channel))
|
close-output-channel
|
||||||
|
|
||||||
|
set-with-fs-context-aligned*!))
|
||||||
|
|
||||||
(define-interface low-channels-interface
|
(define-interface low-channels-interface
|
||||||
(export channel?
|
(export channel?
|
||||||
|
@ -172,17 +174,6 @@
|
||||||
|
|
||||||
open-channels-list))
|
open-channels-list))
|
||||||
|
|
||||||
(define-interface channels-interface
|
|
||||||
(export input-channel?
|
|
||||||
open-input-channel
|
|
||||||
channel-read
|
|
||||||
close-input-channel
|
|
||||||
|
|
||||||
output-channel?
|
|
||||||
open-output-channel
|
|
||||||
channel-write
|
|
||||||
close-output-channel))
|
|
||||||
|
|
||||||
(define-interface ports-interface
|
(define-interface ports-interface
|
||||||
(export port?
|
(export port?
|
||||||
make-port
|
make-port
|
||||||
|
|
|
@ -16,14 +16,27 @@
|
||||||
(= (channel-status thing)
|
(= (channel-status thing)
|
||||||
(enum channel-status-option special-output)))))
|
(enum channel-status-option special-output)))))
|
||||||
|
|
||||||
|
;;; Scsh changes umask and cwd lazily
|
||||||
|
;;; placeholder until scsh sets it
|
||||||
|
(define (with-fs-context-aligned* thunk)
|
||||||
|
(thunk))
|
||||||
|
|
||||||
|
(define (set-with-fs-context-aligned*! wpca*)
|
||||||
|
(set! with-fs-context-aligned* wpca*))
|
||||||
|
|
||||||
|
|
||||||
(define (open-input-channel filename)
|
(define (open-input-channel filename)
|
||||||
(let ((channel (open-channel filename (enum channel-status-option input))))
|
(let ((channel (with-fs-context-aligned*
|
||||||
|
(lambda ()
|
||||||
|
(open-channel filename (enum channel-status-option input))))))
|
||||||
(if (channel? channel)
|
(if (channel? channel)
|
||||||
channel
|
channel
|
||||||
(error "cannot open input file" filename))))
|
(error "cannot open input file" filename))))
|
||||||
|
|
||||||
(define (open-output-channel filename)
|
(define (open-output-channel filename)
|
||||||
(let ((channel (open-channel filename (enum channel-status-option output))))
|
(let ((channel (with-fs-context-aligned*
|
||||||
|
(lambda ()
|
||||||
|
(open-channel filename (enum channel-status-option output))))))
|
||||||
(if (channel? channel)
|
(if (channel? channel)
|
||||||
channel
|
channel
|
||||||
(error "cannot open output file" filename))))
|
(error "cannot open output file" filename))))
|
||||||
|
|
|
@ -247,6 +247,12 @@
|
||||||
|
|
||||||
(initialize-umask)
|
(initialize-umask)
|
||||||
|
|
||||||
|
(set-with-fs-context-aligned*! ; ensure S48 is aligned too
|
||||||
|
(lambda (thunk)
|
||||||
|
(with-cwd-aligned*
|
||||||
|
(lambda ()
|
||||||
|
(with-umask-aligned*
|
||||||
|
thunk)))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;;; Environment per thread
|
;;; Environment per thread
|
||||||
|
|
Loading…
Reference in New Issue