mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Don't forget to delete the output file if the request fails.
Don't delete the output file if -r was specified.
This commit is contained in:
parent
0b74850760
commit
df6f33d182
1 changed files with 3 additions and 1 deletions
|
|
@ -293,6 +293,8 @@ fetch(char *URL, char *path)
|
|||
/* start the transfer */
|
||||
if ((f = fetchGet(url, flags)) == NULL) {
|
||||
warnx("%s", fetchLastErrString);
|
||||
if (!R_flag && !r_flag && !o_stdout)
|
||||
unlink(path);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
|
|
@ -358,7 +360,7 @@ fetch(char *URL, char *path)
|
|||
if (ferror(of))
|
||||
warn("%s", path);
|
||||
if (ferror(f) || ferror(of)) {
|
||||
if (!R_flag && !o_stdout)
|
||||
if (!R_flag && !r_flag && !o_stdout)
|
||||
unlink(path);
|
||||
goto failure;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue