From c26c04dd50655613ac81d2b4b02e362cf550162f Mon Sep 17 00:00:00 2001 From: Morgan Aldridge Date: Sat, 31 Dec 2022 23:40:33 -0500 Subject: [PATCH] Don't use cp --reflink=auto under BSDs. Issue #344 --- common/profile-sync-daemon.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/common/profile-sync-daemon.in b/common/profile-sync-daemon.in index 3c4903d..bc20e2b 100644 --- a/common/profile-sync-daemon.in +++ b/common/profile-sync-daemon.in @@ -326,7 +326,11 @@ ungraceful_state_check() { # at all which can be treated the same way if [[ $CRRE -eq 1 ]]; then - cp -a --reflink=auto "$BACKUP" "$BACKUP-crashrecovery-$NOW" + if [[ "$(uname -s)" =~ BSD ]]; then + cp -a "$BACKUP" "$BACKUP-crashrecovery-$NOW" + else + cp -a --reflink=auto "$BACKUP" "$BACKUP-crashrecovery-$NOW" + fi rm "${DIR%/}" mv --no-target-directory "$BACKUP" "$DIR" fi