From 4d5efe6a05d6f4f4db9901347cf5f7cb9002bed9 Mon Sep 17 00:00:00 2001 From: Timo Teras Date: Sat, 17 Jan 2009 13:34:18 +0200 Subject: [PATCH] archive: utimes modifies file, not link so don't use it for symlinks --- src/archive.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/archive.c b/src/archive.c index 5c1eb91..a05aee2 100644 --- a/src/archive.c +++ b/src/archive.c @@ -257,13 +257,15 @@ int apk_archive_entry_extract(const struct apk_file_info *ae, } } - /* preserve modification time */ - utb.actime = utb.modtime = ae->mtime; - r = utime(fn, &utb); - if (r < 0) { - apk_error("Failed to preserve modification time on %s: %s", - fn, strerror(errno)); - return -errno; + if (!S_ISLNK(ae->mode)) { + /* preserve modification time */ + utb.actime = utb.modtime = ae->mtime; + r = utime(fn, &utb); + if (r < 0) { + apk_error("Failed to preserve modification time on %s: %s", + fn, strerror(errno)); + return -errno; + } } } else { apk_error("Failed to extract %s: %s", ae->name, strerror(errno));