Commit 9e70b1c9 authored by Natanael Copa's avatar Natanael Copa
Browse files

url: rename to .backup rather than unlink before wget

parent 74b5e4f5
......@@ -83,6 +83,7 @@ int apk_url_download(const char *url, const char *file)
pid_t pid;
int status;
char tmp[256];
pid = fork();
if (pid == -1)
......@@ -91,7 +92,8 @@ int apk_url_download(const char *url, const char *file)
if (pid == 0) {
dup2(open("/dev/null", O_RDONLY), STDIN_FILENO);
snprintf(tmp, sizeof(tmp), "%s.backup", file);
rename(file, tmp);
execlp("wget", "wget", "-q", "-O", file, url, NULL);
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