mirror of
https://github.com/ksherlock/gopher.git
synced 2024-12-26 06:29:21 +00:00
read_binary_size return value on read error
This commit is contained in:
parent
fad3fc48ea
commit
9457120327
10
common.c
10
common.c
@ -4,6 +4,8 @@
|
||||
*/
|
||||
#pragma noroot
|
||||
#pragma optimize 79
|
||||
#pragma debug 0x8000
|
||||
#pragma lint -1
|
||||
|
||||
#include <Memory.h>
|
||||
#include <MiscTool.h>
|
||||
@ -39,6 +41,7 @@ int read_binary(Word ipid, FILE *file, ReadBlock *dcb)
|
||||
DecBusy();
|
||||
|
||||
count = rb.rrBuffCount;
|
||||
|
||||
if (!count)
|
||||
{
|
||||
if (rv) break;
|
||||
@ -48,6 +51,8 @@ int read_binary(Word ipid, FILE *file, ReadBlock *dcb)
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
tcount = fwrite(buffer, 1, count, file);
|
||||
if (dcb) dcb->transferCount += tcount;
|
||||
|
||||
@ -89,9 +94,11 @@ int read_binary_size(Word ipid, FILE *file, ReadBlock *dcb)
|
||||
DecBusy();
|
||||
|
||||
count = rb.rrBuffCount;
|
||||
|
||||
|
||||
if (!count)
|
||||
{
|
||||
if (rv) break;
|
||||
if (rv) return -1;
|
||||
IncBusy();
|
||||
TCPIPPoll();
|
||||
DecBusy();
|
||||
@ -109,7 +116,6 @@ int read_binary_size(Word ipid, FILE *file, ReadBlock *dcb)
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user