1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

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.
This commit is contained in:
Garrett Wollman 1997-07-26 20:00:05 +00:00
parent 2ec04c7076
commit efd4ad4cd2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=27709

View File

@ -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 @@ http_retrieve(struct fetch_state *fs)
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",
} 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 @@ http_retrieve(struct fetch_state *fs)
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",
} 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");