mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-12-25 08:30:05 -07:00
kiss: ensure move only occurs when copy fails
This commit is contained in:
parent
e671914090
commit
7e2a79a7fa
4
kiss
4
kiss
@ -1117,14 +1117,14 @@ pkg_install_files() {
|
||||
|
||||
# Copy the file to the destination directory with the
|
||||
# temporary name created above.
|
||||
cp -fP "$2$file" "$__tmp"
|
||||
cp -fP "$2$file" "$__tmp" &&
|
||||
|
||||
# Atomically move the temporary file to its final
|
||||
# destination. The running processes will either get
|
||||
# the old file or the new one.
|
||||
mv -f "$__tmp" "$_file"
|
||||
fi
|
||||
esac
|
||||
esac || return 1
|
||||
done
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user