diff options
author | wollman <wollman@FreeBSD.org> | 1997-07-26 20:00:05 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1997-07-26 20:00:05 +0000 |
commit | 183f1f7031662853b0b679cd0903312ef2d62441 (patch) | |
tree | f3bcdc638ee11687952e0dcc4778bb1b6d0f10fb /usr.bin/fetch/http.c | |
parent | 989de48b81de557857e3071f35e7a526eb2e8f6e (diff) | |
download | FreeBSD-src-183f1f7031662853b0b679cd0903312ef2d62441.zip FreeBSD-src-183f1f7031662853b0b679cd0903312ef2d62441.tar.gz |
Fix the error message for when mirroring and restarting are rejected
due to the output not being a regular file. Also split the error message
in any error case here to be on two lines to lessen the likelihood of it
being too long to fit on just one.
Diffstat (limited to 'usr.bin/fetch/http.c')
-rw-r--r-- | usr.bin/fetch/http.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/usr.bin/fetch/http.c b/usr.bin/fetch/http.c index ce7bd29..de49e16 100644 --- a/usr.bin/fetch/http.c +++ b/usr.bin/fetch/http.c @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: http.c,v 1.7 1997/07/25 19:35:43 wollman Exp $ + * $Id: http.c,v 1.8 1997/07/26 19:25:56 wollman Exp $ */ #include <sys/types.h> @@ -527,9 +527,13 @@ retry: addstr(iov, n, "If-Modified-Since: "); addstr(iov, n, format_http_date(stab.st_mtime)); addstr(iov, n, "\r\n"); - } else if (errno != 0) { - warn("%s: cannot mirror; will retrieve anew", - fs->fs_outputfile); + } else if (errno != 0 || !S_ISREG(stab.st_mode)) { + if (errno != 0) + warn("%s", fs->fs_outputfile); + else + warnx("%s: not a regular file", + fs->fs_outputfile); + warnx("cannot mirror; will retrieve anew"); } } if (restarting) { @@ -545,14 +549,14 @@ retry: sprintf(rangebuf, "Range: bytes=%qd-\r\n", (quad_t)stab.st_size); addstr(iov, n, rangebuf); - } else if (errno != 0) { - warn("%s: cannot restart; will retrieve anew", - fs->fs_outputfile); - restarting = 0; - } else { - warnx("%s: cannot restart; will retrieve anew", - fs->fs_outputfile); + } else if (errno != 0 || !S_ISREG(stab.st_mode)) { + if (errno != 0) + warn("%s", fs->fs_outputfile); + else + warnx("%s: not a regular file", + fs->fs_outputfile); restarting = 0; + warnx("cannot restart; will retrieve anew"); } } addstr(iov, n, "\r\n"); |