diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-02-06 06:09:26 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-02-06 06:09:26 -0500 |
commit | 7e2a47c7bb2378ae1c61cce86227eb23ea06f7e0 (patch) | |
tree | cdbba34d37a0f65c710752fe3ddba657d7317b61 | |
parent | bf3bb228f028cc3d990f1dd54d8d03af038fe91d (diff) | |
download | stasis-7e2a47c7bb2378ae1c61cce86227eb23ea06f7e0.tar.gz |
Gracefully handle a failure to download a file
-rw-r--r-- | src/artifactory.c | 4 |
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; |