Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e935f37d authored by Dario Freni's avatar Dario Freni Committed by Automerger Merge Worker
Browse files

Merge "Preserve attributes on rollback." am: b1e8640f am: 70da2fc3 am: cd3e8c60

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1927454

Change-Id: Idccda1e84d74ae56f1f24f81a1e44a7054e2616b
parents d9383d57 cd3e8c60
Loading
Loading
Loading
Loading
+9 −10
Original line number Original line Diff line number Diff line
@@ -1131,16 +1131,15 @@ binder::Status InstalldNativeService::fixupAppData(const std::optional<std::stri
}
}


static int32_t copy_directory_recursive(const char* from, const char* to) {
static int32_t copy_directory_recursive(const char* from, const char* to) {
    char *argv[] = {
    char* argv[] =
        (char*) kCpPath,
            {(char*)kCpPath,
             (char*)"-F", /* delete any existing destination file first (--remove-destination) */
             (char*)"-F", /* delete any existing destination file first (--remove-destination) */
        (char*) "-p", /* preserve timestamps, ownership, and permissions */
             (char*)"--preserve=mode,ownership,timestamps,xattr", /* preserve properties */
             (char*)"-R", /* recurse into subdirectories (DEST must be a directory) */
             (char*)"-R", /* recurse into subdirectories (DEST must be a directory) */
             (char*)"-P", /* Do not follow symlinks [default] */
             (char*)"-P", /* Do not follow symlinks [default] */
             (char*)"-d", /* don't dereference symlinks */
             (char*)"-d", /* don't dereference symlinks */
             (char*)from,
             (char*)from,
        (char*) to
             (char*)to};
    };


    LOG(DEBUG) << "Copying " << from << " to " << to;
    LOG(DEBUG) << "Copying " << from << " to " << to;
    return logwrap_fork_execvp(ARRAY_SIZE(argv), argv, nullptr, false, LOG_ALOG, false, nullptr);
    return logwrap_fork_execvp(ARRAY_SIZE(argv), argv, nullptr, false, LOG_ALOG, false, nullptr);