From 021a5dafec3164cdedd30f1acee94b9d3fd19228 Mon Sep 17 00:00:00 2001
From: Vasilij Schneidermann <mail@vasilij.de>
Date: Wed, 13 May 2020 09:45:00 +0200
Subject: [PATCH] Use 0666 as default file-open mode
---
scsh-process/1.5.2/scsh-process.scm | 31 +++++++++++++++++++++--------
1 file changed, 23 insertions(+), 8 deletions(-)
diff --git a/scsh-process/1.5.2/scsh-process.scm b/scsh-process/1.5.2/scsh-process.scm
index a6d4bdf..4714746 100644
|
a
|
b
|
|
| 55 | 55 | (import scheme) |
| 56 | 56 | |
| 57 | 57 | (cond-expand |
| 58 | | (chicken-5 (import (chicken base) (chicken condition) (chicken io) |
| 59 | | (chicken port) (chicken file) (chicken file posix) |
| 60 | | (chicken fixnum) (chicken string) (chicken process) |
| 61 | | (chicken process signal) srfi-18 llrb-fixnum-table)) |
| | 58 | (chicken-5 (import (chicken base) (chicken bitwise) (chicken condition) |
| | 59 | (chicken io) (chicken port) (chicken file) |
| | 60 | (chicken file posix) (chicken fixnum) (chicken string) |
| | 61 | (chicken process) (chicken process signal) |
| | 62 | srfi-18 llrb-fixnum-table)) |
| 62 | 63 | (else (import chicken) |
| 63 | 64 | (use data-structures (rename extras (read-file read-list)) |
| 64 | 65 | utils files ports posix srfi-1 srfi-18) |
| … |
… |
|
| 370 | 371 | (define (run/file* thunk) |
| 371 | 372 | (let ((temp-file (create-temporary-file))) |
| 372 | 373 | (wait (fork (lambda () |
| 373 | | (let ((fd (file-open temp-file open/wronly))) |
| | 374 | (let ((fd (file-open temp-file |
| | 375 | open/wronly |
| | 376 | (bitwise-ior perm/irusr perm/iwusr |
| | 377 | perm/irgrp perm/iwgrp |
| | 378 | perm/iroth perm/iwoth)))) |
| 374 | 379 | (duplicate-fileno fd 1) |
| 375 | 380 | (with-output-to-port (open-output-file* 1) thunk))))) |
| 376 | 381 | temp-file)) |
| … |
… |
|
| 449 | 454 | ((_ (> ?fd ?file-name)) |
| 450 | 455 | (duplicate-fileno |
| 451 | 456 | (file-open (maybe->string `?file-name) |
| 452 | | (fx+ (fx+ open/wronly open/creat) open/trunc)) |
| | 457 | (fx+ (fx+ open/wronly open/creat) open/trunc) |
| | 458 | (bitwise-ior perm/irusr perm/iwusr |
| | 459 | perm/irgrp perm/iwgrp |
| | 460 | perm/iroth perm/iwoth)) |
| 453 | 461 | `?fd)) |
| 454 | 462 | ((_ (>> ?fd ?file-name)) |
| 455 | 463 | (duplicate-fileno (file-open (maybe->string `?file-name) |
| 456 | | (fx+ open/wronly (fx+ open/append open/creat))) |
| | 464 | (fx+ open/wronly (fx+ open/append open/creat)) |
| | 465 | (bitwise-ior perm/irusr perm/iwusr |
| | 466 | perm/irgrp perm/iwgrp |
| | 467 | perm/iroth perm/iwoth)) |
| 457 | 468 | `?fd)) |
| 458 | 469 | ((_ (< ?fd ?file-name)) |
| 459 | | (duplicate-fileno (file-open (maybe->string `?file-name) open/rdonly) |
| | 470 | (duplicate-fileno (file-open (maybe->string `?file-name) |
| | 471 | open/rdonly |
| | 472 | (bitwise-ior perm/irusr perm/iwusr |
| | 473 | perm/irgrp perm/iwgrp |
| | 474 | perm/iroth perm/iwoth)) |
| 460 | 475 | `?fd)) |
| 461 | 476 | ((_ (<< ?fd ?object)) |
| 462 | 477 | (fork/pipe+ `((1 ?fd)) (lambda () (display `?object (open-output-file* 1))))) |