Be more aggressive about timeouts.

This commit is contained in:
Jordan K. Hubbard 1997-01-17 19:00:38 +00:00
parent 459cd7dc1e
commit c7bdc98ef3
4 changed files with 10 additions and 6 deletions

View File

@ -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 */

View File

@ -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 {

View File

@ -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 */

View File

@ -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 {