With-umask-align for the rest of the syscalls.
This commit is contained in:
parent
7a45d9cc01
commit
75fa4c1852
|
@ -328,12 +328,13 @@
|
||||||
;;; replace rts/channel-port.scm begin
|
;;; replace rts/channel-port.scm begin
|
||||||
(define (open-file fname flags . maybe-mode)
|
(define (open-file fname flags . maybe-mode)
|
||||||
(with-cwd-aligned
|
(with-cwd-aligned
|
||||||
|
(with-umask-aligned
|
||||||
(let ((fd (apply open-fdes fname flags maybe-mode))
|
(let ((fd (apply open-fdes fname flags maybe-mode))
|
||||||
(access (bitwise-and flags open/access-mask)))
|
(access (bitwise-and flags open/access-mask)))
|
||||||
((if (or (= access open/read) (= access open/read+write))
|
((if (or (= access open/read) (= access open/read+write))
|
||||||
make-input-fdport
|
make-input-fdport
|
||||||
make-output-fdport)
|
make-output-fdport)
|
||||||
fd 0))))
|
fd 0)))))
|
||||||
|
|
||||||
(define (open-input-file fname . maybe-flags)
|
(define (open-input-file fname . maybe-flags)
|
||||||
(let ((flags (:optional maybe-flags 0)))
|
(let ((flags (:optional maybe-flags 0)))
|
||||||
|
@ -635,6 +636,7 @@
|
||||||
(define (call-with-mumble-file open close)
|
(define (call-with-mumble-file open close)
|
||||||
(lambda (string proc)
|
(lambda (string proc)
|
||||||
(with-cwd-aligned
|
(with-cwd-aligned
|
||||||
|
(with-umask-aligned
|
||||||
(let ((port #f))
|
(let ((port #f))
|
||||||
(dynamic-wind (lambda ()
|
(dynamic-wind (lambda ()
|
||||||
(if port
|
(if port
|
||||||
|
@ -644,7 +646,7 @@
|
||||||
(lambda () (proc port))
|
(lambda () (proc port))
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(if port
|
(if port
|
||||||
(close port))))))))
|
(close port)))))))))
|
||||||
|
|
||||||
;;; replace rts/channel-port.scm begin
|
;;; replace rts/channel-port.scm begin
|
||||||
(define call-with-input-file
|
(define call-with-input-file
|
||||||
|
|
|
@ -340,6 +340,8 @@
|
||||||
set-umask
|
set-umask
|
||||||
with-umask*
|
with-umask*
|
||||||
(with-umask :syntax)
|
(with-umask :syntax)
|
||||||
|
with-umask-aligned*
|
||||||
|
(with-umask-aligned :syntax)
|
||||||
|
|
||||||
process-chdir
|
process-chdir
|
||||||
process-cwd
|
process-cwd
|
||||||
|
|
|
@ -411,6 +411,9 @@
|
||||||
(define-simple-syntax (with-cwd-aligned body ...)
|
(define-simple-syntax (with-cwd-aligned body ...)
|
||||||
(with-cwd-aligned* (lambda () body ...)))
|
(with-cwd-aligned* (lambda () body ...)))
|
||||||
|
|
||||||
|
(define-simple-syntax (with-umask-aligned body ...)
|
||||||
|
(with-cwd-aligned* (lambda () body ...)))
|
||||||
|
|
||||||
(define-simple-syntax (with-umask mask . body)
|
(define-simple-syntax (with-umask mask . body)
|
||||||
(with-umask* mask (lambda () . body)))
|
(with-umask* mask (lambda () . body)))
|
||||||
|
|
||||||
|
|
|
@ -545,7 +545,8 @@
|
||||||
|
|
||||||
(define (open-fdes path flags . maybe-mode) ; mode defaults to 0666
|
(define (open-fdes path flags . maybe-mode) ; mode defaults to 0666
|
||||||
(with-cwd-aligned
|
(with-cwd-aligned
|
||||||
(%open path flags (:optional maybe-mode #o666))))
|
(with-umask-aligned
|
||||||
|
(%open path flags (:optional maybe-mode #o666)))))
|
||||||
|
|
||||||
|
|
||||||
(define-stubless-foreign pipe-fdes () "scheme_pipe")
|
(define-stubless-foreign pipe-fdes () "scheme_pipe")
|
||||||
|
|
Loading…
Reference in New Issue