Be more aggressive about timeouts.
This commit is contained in:
parent
459cd7dc1e
commit
c7bdc98ef3
@ -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 New Issue
Block a user