mirror of
https://github.com/freebsd/freebsd-src
synced 2024-11-05 18:22:52 +00:00
Be more aggressive about timeouts.
This commit is contained in:
parent
459cd7dc1e
commit
c7bdc98ef3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=21815
4 changed files with 10 additions and 6 deletions
|
@ -497,8 +497,10 @@ distExtract(char *parent, Distribution *me)
|
|||
alarm_set(MEDIA_TIMEOUT, media_timeout);
|
||||
n = fread(buf, 1, BUFSIZ, fp);
|
||||
alarm_clear();
|
||||
if (n <= 0 || AlarmWentOff)
|
||||
if (n <= 0 || AlarmWentOff) {
|
||||
msgConfirm("Read error on media (timeout or user abort).\n");
|
||||
break;
|
||||
}
|
||||
total += n;
|
||||
|
||||
/* Print statistics about how we're doing */
|
||||
|
|
|
@ -599,11 +599,11 @@ mediaExtractDist(char *dir, char *dist, FILE *fp)
|
|||
while ((i = fread(buf, 1, BUFSIZ, fp)) > 0) {
|
||||
alarm_clear();
|
||||
if (AlarmWentOff) {
|
||||
msgDebug("Failure to read from media - timeout or user abort.\n");
|
||||
msgConfirm("Failure to read from media - timeout or user abort.\n");
|
||||
break;
|
||||
}
|
||||
if (write(qfd[1], buf, i) != i) {
|
||||
msgDebug("Write error on transfer to cpio process, try of %d bytes\n", i);
|
||||
msgConfirm("Write error on transfer to cpio process, try of %d bytes\n", i);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -497,8 +497,10 @@ distExtract(char *parent, Distribution *me)
|
|||
alarm_set(MEDIA_TIMEOUT, media_timeout);
|
||||
n = fread(buf, 1, BUFSIZ, fp);
|
||||
alarm_clear();
|
||||
if (n <= 0 || AlarmWentOff)
|
||||
if (n <= 0 || AlarmWentOff) {
|
||||
msgConfirm("Read error on media (timeout or user abort).\n");
|
||||
break;
|
||||
}
|
||||
total += n;
|
||||
|
||||
/* Print statistics about how we're doing */
|
||||
|
|
|
@ -599,11 +599,11 @@ mediaExtractDist(char *dir, char *dist, FILE *fp)
|
|||
while ((i = fread(buf, 1, BUFSIZ, fp)) > 0) {
|
||||
alarm_clear();
|
||||
if (AlarmWentOff) {
|
||||
msgDebug("Failure to read from media - timeout or user abort.\n");
|
||||
msgConfirm("Failure to read from media - timeout or user abort.\n");
|
||||
break;
|
||||
}
|
||||
if (write(qfd[1], buf, i) != i) {
|
||||
msgDebug("Write error on transfer to cpio process, try of %d bytes\n", i);
|
||||
msgConfirm("Write error on transfer to cpio process, try of %d bytes\n", i);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in a new issue