mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-05 10:09:30 +00: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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=62245
@ -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 New Issue
Block a user