From 7e4af6a4def6f95619f5154154bffd370a3d1d64 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 4 May 1996 17:38:55 +0000 Subject: [PATCH] Fix bug under OS/2: when overwriting a file that has its "archived" bit cleared, the bit should be set but was not. --- v7/src/edwin/dos.scm | 8 +++++++- v7/src/edwin/fileio.scm | 6 ++++-- v7/src/edwin/os2.scm | 8 ++++++-- v7/src/edwin/unix.scm | 5 ++++- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/v7/src/edwin/dos.scm b/v7/src/edwin/dos.scm index 569bc6af7..a5c99e5fb 100644 --- a/v7/src/edwin/dos.scm +++ b/v7/src/edwin/dos.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: dos.scm,v 1.35 1996/04/24 02:38:58 cph Exp $ +;;; $Id: dos.scm,v 1.36 1996/05/04 17:38:40 cph Exp $ ;;; ;;; Copyright (c) 1992-96 Massachusetts Institute of Technology ;;; @@ -78,6 +78,12 @@ (define (os/set-file-modes-writable! pathname) (set-file-modes! pathname #o777)) +(define os/restore-modes-to-updated-file! + ;; **** If implementation is changed so that file modes are DOS + ;; attributes rather than an emulation of unix modes, this will have + ;; to be changed to work like the OS/2 code. **** + set-file-modes!) + (define (os/scheme-can-quit?) #t) diff --git a/v7/src/edwin/fileio.scm b/v7/src/edwin/fileio.scm index 945bf78c0..6721c089c 100644 --- a/v7/src/edwin/fileio.scm +++ b/v7/src/edwin/fileio.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: fileio.scm,v 1.135 1996/04/24 02:30:01 cph Exp $ +;;; $Id: fileio.scm,v 1.136 1996/05/04 17:37:30 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-96 Massachusetts Institute of Technology ;;; @@ -525,7 +525,9 @@ Otherwise, a message is written both before and after long file writes." (if modes (catch-file-errors (lambda () unspecific) - (lambda () (set-file-modes! pathname modes)))))))))) + (lambda () + (os/restore-modes-to-updated-file! pathname + modes)))))))))) (define (verify-visited-file-modification-time? buffer) (let ((truename (buffer-truename buffer)) diff --git a/v7/src/edwin/os2.scm b/v7/src/edwin/os2.scm index 3cf3c3b81..6042338a1 100644 --- a/v7/src/edwin/os2.scm +++ b/v7/src/edwin/os2.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: os2.scm,v 1.29 1996/04/24 02:38:48 cph Exp $ +;;; $Id: os2.scm,v 1.30 1996/05/04 17:38:12 cph Exp $ ;;; ;;; Copyright (c) 1994-96 Massachusetts Institute of Technology ;;; @@ -78,7 +78,11 @@ result)))))) (define (os/set-file-modes-writable! pathname) - (set-file-modes! pathname (fix:andc (file-modes pathname) #x0001))) + (set-file-modes! pathname + (fix:andc (file-modes pathname) os2-file-mode/read-only))) + +(define (os/restore-modes-to-updated-file! pathname modes) + (set-file-modes! pathname (fix:or modes os2-file-mode/archived))) (define (os/scheme-can-quit?) #f) diff --git a/v7/src/edwin/unix.scm b/v7/src/edwin/unix.scm index 95d0c5900..c3b9bb10c 100644 --- a/v7/src/edwin/unix.scm +++ b/v7/src/edwin/unix.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: unix.scm,v 1.68 1996/04/24 02:38:37 cph Exp $ +;;; $Id: unix.scm,v 1.69 1996/05/04 17:38:55 cph Exp $ ;;; ;;; Copyright (c) 1989-96 Massachusetts Institute of Technology ;;; @@ -775,6 +775,9 @@ option, instead taking -P ." (define (os/set-file-modes-writable! pathname) (set-file-modes! pathname #o777)) +(define os/restore-modes-to-updated-file! + set-file-modes!) + (define (os/sendmail-program) (if (file-exists? "/usr/lib/sendmail") "/usr/lib/sendmail" -- 2.25.1