projects
/
idzebra-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f28af03
)
Changed reaction to read return values.
author
Sebastian Hammer
<quinn@indexdata.com>
Wed, 24 Aug 1994 09:37:17 +0000
(09:37 +0000)
committer
Sebastian Hammer
<quinn@indexdata.com>
Wed, 24 Aug 1994 09:37:17 +0000
(09:37 +0000)
bfile/mfile.c
patch
|
blob
|
history
diff --git
a/bfile/mfile.c
b/bfile/mfile.c
index
ab74d4f
..
5f0dd22
100644
(file)
--- a/
bfile/mfile.c
+++ b/
bfile/mfile.c
@@
-4,7
+4,10
@@
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: mfile.c,v $
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: mfile.c,v $
- * Revision 1.2 1994-08-23 14:50:48 quinn
+ * Revision 1.3 1994-08-24 09:37:17 quinn
+ * Changed reaction to read return values.
+ *
+ * Revision 1.2 1994/08/23 14:50:48 quinn
* Fixed mf_close().
*
* Revision 1.1 1994/08/23 14:41:33 quinn
* Fixed mf_close().
*
* Revision 1.1 1994/08/23 14:41:33 quinn
@@
-293,14
+296,19
@@
int mf_close(MFile mf)
*/
int mf_read(MFile mf, int no, int offset, int num, void *buf)
{
*/
int mf_read(MFile mf, int no, int offset, int num, void *buf)
{
+ int rd;
+
if (file_position(mf, no) < 0)
exit(1);
if (file_position(mf, no) < 0)
exit(1);
- if (read(mf->files[mf->cur_file].fd, buf, mf->blocksize) < mf->blocksize)
+ if ((rd = read(mf->files[mf->cur_file].fd, buf, mf->blocksize)) < 0)
{
log(LOG_FATAL|LOG_ERRNO, "Read failed");
exit(1);
}
{
log(LOG_FATAL|LOG_ERRNO, "Read failed");
exit(1);
}
- return 0;
+ else if (rd < mf->blocksize)
+ return 0;
+ else
+ return 1;
}
/*
}
/*