Commit 8806ce87 authored by Natanael Copa's avatar Natanael Copa
Browse files

archive: append .apk-new to hard link targets

Otherwise will link(2) fail since it does not exist.
parent 042879f4
......@@ -20,6 +20,7 @@
#include <unistd.h>
#include <sysexits.h>
#include <sys/wait.h>
#include <limits.h>
#include "apk_defines.h"
#include "apk_archive.h"
......@@ -334,7 +335,10 @@ int apk_archive_entry_extract(const struct apk_file_info *ae,
r = 0;
close(fd);
} else {
r = link(ae->link_target, fn);
char link_target[PATH_MAX];
snprintf(link_target, sizeof(link_target),
"%s.apk-new", ae->link_target);
r = link(link_target, fn);
}
break;
case S_IFLNK:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment