aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-02-06 06:09:26 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-02-06 06:09:26 -0500
commit7e2a47c7bb2378ae1c61cce86227eb23ea06f7e0 (patch)
treecdbba34d37a0f65c710752fe3ddba657d7317b61 /src
parentbf3bb228f028cc3d990f1dd54d8d03af038fe91d (diff)
downloadstasis-7e2a47c7bb2378ae1c61cce86227eb23ea06f7e0.tar.gz
Gracefully handle a failure to download a file
Diffstat (limited to 'src')
-rw-r--r--src/artifactory.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/artifactory.c b/src/artifactory.c
index c44c95f..0c73b69 100644
--- a/src/artifactory.c
+++ b/src/artifactory.c
@@ -57,9 +57,11 @@ int artifactory_download_cli(char *dest,
fprintf(stderr, "%s: %s: %s", __FUNCTION__, path, strerror(errno));
return -1;
}
+
sprintf(path + strlen(path), "/%s", remote_filename);
- if (download(url, path)) {
+ if (HTTP_ERROR(download(url, path, NULL))) {
fprintf(stderr, "%s: download failed: %s\n", __FUNCTION__, url);
+ return -1;
}
chmod(path, 0755);
return 0;