[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 47f9f7b 2/5: Prepare to replace 'cp' with 'in
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 47f9f7b 2/5: Prepare to replace 'cp' with 'install' where necessary |
Date: |
Sat, 13 Jun 2020 17:37:02 -0400 (EDT) |
branch: master
commit 47f9f7bbfdb9f159a7d7393e8e163d5445d746ab
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Prepare to replace 'cp' with 'install' where necessary
Defined $(INSTALL) in platform-configuration makefiles.
If two different users successively perform the same 'cp' operations
with '-p' (which is implied by '-a'), failures like this occur:
cp: preserving times for '/some/file': Operation not permitted
and 'install' should be used instead.
Merely removing '-p' or '-a' from a 'cp' command isn't ideal. For
currently-running executable files in particular, 'cp' opens the
destination file and replaces its contents, which the OS probably had
mmap'ed, and hilarity ensues. OTOH, 'install' first unlinks the file,
then writes the new contents with a new inode; the old version's inode
is removed from directories, yet it persists until the last process
using it exits.
---
msw_cygwin.make | 1 +
msw_generic.make | 1 +
msw_wsl.make | 1 +
posix_fhs.make | 1 +
4 files changed, 4 insertions(+)
diff --git a/msw_cygwin.make b/msw_cygwin.make
index f6faa8d..a8c6271 100644
--- a/msw_cygwin.make
+++ b/msw_cygwin.make
@@ -97,6 +97,7 @@ CP := cp
DATE := date
ECHO := echo
GZIP := gzip
+INSTALL := install
LS := ls
MKDIR := mkdir
MV := mv
diff --git a/msw_generic.make b/msw_generic.make
index 797bc05..41b52e0 100644
--- a/msw_generic.make
+++ b/msw_generic.make
@@ -77,6 +77,7 @@ CP := cp
DATE := date
ECHO := echo
GZIP := gzip
+INSTALL := install
LS := ls
MKDIR := mkdir
MV := mv
diff --git a/msw_wsl.make b/msw_wsl.make
index 3d325cd..d6f95a6 100644
--- a/msw_wsl.make
+++ b/msw_wsl.make
@@ -77,6 +77,7 @@ CP := cp
DATE := date
ECHO := echo
GZIP := gzip
+INSTALL := install
LS := ls
MKDIR := mkdir
MV := mv
diff --git a/posix_fhs.make b/posix_fhs.make
index ae261de..13b52a1 100644
--- a/posix_fhs.make
+++ b/posix_fhs.make
@@ -65,6 +65,7 @@ CP := cp
DATE := date
ECHO := echo
GZIP := gzip
+INSTALL := install
LS := ls
MKDIR := mkdir
MV := mv