diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2005-12-30 23:36:26 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2005-12-30 23:36:26 +0000 |
commit | 15e2d64e15db82d0bfcbb14945b290038a3f0031 (patch) | |
tree | 7e4b503d5019179785ddd332ec549f20bebf0e5d /usr.bin/fetch/fetch.c | |
parent | ba084f6a80d90961d256f10e28811df31d9d69f7 (diff) | |
download | src-15e2d64e15db82d0bfcbb14945b290038a3f0031.tar.gz src-15e2d64e15db82d0bfcbb14945b290038a3f0031.zip |
Notes
Diffstat (limited to 'usr.bin/fetch/fetch.c')
-rw-r--r-- | usr.bin/fetch/fetch.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/fetch/fetch.c b/usr.bin/fetch/fetch.c index e37e2843a191..027c6f628ea1 100644 --- a/usr.bin/fetch/fetch.c +++ b/usr.bin/fetch/fetch.c @@ -424,17 +424,17 @@ fetch(char *URL, const char *path) r = stat(path, &sb); if (r == 0 && r_flag && S_ISREG(sb.st_mode)) { url->offset = sb.st_size; - } else { + } else if (r == -1 || !S_ISREG(sb.st_mode)) { /* * Whatever value sb.st_size has now is either * wrong (if stat(2) failed) or irrelevant (if the * path does not refer to a regular file) */ sb.st_size = -1; - if (r == -1 && errno != ENOENT) { - warnx("%s: stat()", path); - goto failure; - } + } + if (r == -1 && errno != ENOENT) { + warnx("%s: stat()", path); + goto failure; } } |