index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dave Reisner <dreisner@archlinux.org> | 2011-08-17 19:45:57 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-08-17 21:03:43 -0500 |
commit | 9f139550f815e2970b8929094e50acfd8b4cc2b7 (patch) | |
tree | 8d7225c6dc4c74d1d4bcc9824014f56eae2af909 | |
parent | 2dbdfe078847dc1247db77580655b387f746ba28 (diff) |
-rw-r--r-- | lib/libalpm/dload.c | 8 |
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c index 0cd0bf7b..68a68e9c 100644 --- a/lib/libalpm/dload.c +++ b/lib/libalpm/dload.c @@ -180,7 +180,7 @@ static size_t parse_headers(void *ptr, size_t size, size_t nmemb, void *user) static int curl_download_internal(struct dload_payload *payload, const char *localpath, char **final_file) { - int ret = -1, should_unlink = 0; + int ret = -1, should_unlink = !payload->allow_resume; FILE *localf = NULL; const char *useragent; const char *open_mode = "wb"; @@ -313,16 +313,12 @@ static int curl_download_internal(struct dload_payload *payload, case CURLE_ABORTED_BY_CALLBACK: goto cleanup; case CURLE_OPERATION_TIMEDOUT: - dload_interrupted = 1; /* fallthrough */ default: if(!payload->errors_ok) { handle->pm_errno = ALPM_ERR_LIBCURL; _alpm_log(handle, ALPM_LOG_ERROR, _("failed retrieving file '%s' from %s : %s\n"), payload->filename, hostname, error_buffer); - if(!dload_interrupted) { - unlink(tempfile); - } } else { _alpm_log(handle, ALPM_LOG_DEBUG, "failed retrieving file '%s' from %s : %s\n", payload->filename, hostname, error_buffer); @@ -398,7 +394,7 @@ cleanup: } } - if(dload_interrupted && should_unlink) { + if((ret == -1 || dload_interrupted) && should_unlink) { unlink(tempfile); } |