summaryrefslogtreecommitdiff
path: root/src/archive.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-01-17 13:34:18 +0200
committerTimo Teras <timo.teras@iki.fi>2009-01-17 13:34:18 +0200
commit4d5efe6a05d6f4f4db9901347cf5f7cb9002bed9 (patch)
treec05a37e7924d0f4b2c78eb89eddf34822860832d /src/archive.c
parent0365f7462b2e8f5323ba6a9477a411466447b8b2 (diff)
downloadapk-tools-4d5efe6a05d6f4f4db9901347cf5f7cb9002bed9.tar.gz
apk-tools-4d5efe6a05d6f4f4db9901347cf5f7cb9002bed9.tar.bz2
apk-tools-4d5efe6a05d6f4f4db9901347cf5f7cb9002bed9.tar.xz
apk-tools-4d5efe6a05d6f4f4db9901347cf5f7cb9002bed9.zip
archive: utimes modifies file, not link so don't use it for symlinks
Diffstat (limited to 'src/archive.c')
-rw-r--r--src/archive.c16
1 files 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));