summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2002-08-28 02:54:04 +0000
committerMike Fulbright <msf@redhat.com>2002-08-28 02:54:04 +0000
commitdafbbc82624a121db6bd60756811c0b0f50a8840 (patch)
treec903f9e34a060669aafcf854c29de0b87c68e3c3
parenta54c555a5e7b79619811369f0a4cc684932ff539 (diff)
downloadanaconda-dafbbc82624a121db6bd60756811c0b0f50a8840.tar.gz
anaconda-dafbbc82624a121db6bd60756811c0b0f50a8840.tar.xz
anaconda-dafbbc82624a121db6bd60756811c0b0f50a8840.zip
check return codes like a good boy
-rw-r--r--isomd5sum/checkisomd5.c4
-rw-r--r--isomd5sum/implantisomd5.c4
-rw-r--r--loader/mediacheck.c4
3 files changed, 9 insertions, 3 deletions
diff --git a/isomd5sum/checkisomd5.c b/isomd5sum/checkisomd5.c
index a6794dbf7..557d04254 100644
--- a/isomd5sum/checkisomd5.c
+++ b/isomd5sum/checkisomd5.c
@@ -36,7 +36,9 @@ int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isosize, in
offset = (16L * 2048L);
for (;1;) {
- read(isofd, buf, 2048);
+ if (read(isofd, buf, 2048) <=0)
+ return ((long long)-1);
+
if (buf[0] == 1)
/* found primary volume descriptor */
break;
diff --git a/isomd5sum/implantisomd5.c b/isomd5sum/implantisomd5.c
index 4b1ec3c53..58ee5f10f 100644
--- a/isomd5sum/implantisomd5.c
+++ b/isomd5sum/implantisomd5.c
@@ -33,7 +33,9 @@ int parsepvd(int isofd, char *mediasum, long long *isosize) {
offset = (16L * 2048L);
for (;1;) {
- read(isofd, buf, 2048);
+ if (read(isofd, buf, 2048) < 0)
+ return ((long long)-1);
+
if (buf[0] == 1)
/* found primary volume descriptor */
break;
diff --git a/loader/mediacheck.c b/loader/mediacheck.c
index 02f92c0b3..f82a5fd37 100644
--- a/loader/mediacheck.c
+++ b/loader/mediacheck.c
@@ -50,7 +50,9 @@ int parsepvd(int isofd, char *mediasum, int *skipsectors, long long *isosize, in
offset = (16L * 2048L);
for (;1;) {
- read(isofd, buf, 2048);
+ if (read(isofd, buf, 2048) <= 0)
+ return ((long long)-1);
+
if (buf[0] == 1)
/* found primary volume descriptor */
break;