]> git.llucax.com Git - z.facultad/75.06/emufs.git/blobdiff - emufs/fsc.c
* Pocos cambios.
[z.facultad/75.06/emufs.git] / emufs / fsc.c
index 4aaaa177862fc4edf72a4f0a50c8c2345714ad17..95d378aa5ad5f8d0f0903beca7a694c5b97c574a 100644 (file)
@@ -125,7 +125,10 @@ int emufs_fsc_agregar_gap(EMUFS *emu, EMUFS_OFFSET marker, EMUFS_FREE freespace)
                /* Busco el gap que sucede a este */
                fseek(f_fsc,0,SEEK_SET);
                while (!feof(f_fsc)) {
                /* Busco el gap que sucede a este */
                fseek(f_fsc,0,SEEK_SET);
                while (!feof(f_fsc)) {
-                       fread(&gap_aux,sizeof(EMUFS_FSC),1,f_fsc);
+                       if (fread(&gap_aux,sizeof(EMUFS_FSC),1,f_fsc) != 1) {
+                               if (feof(f_fsc)) break;
+                               PERR("error al leer archivo fsc");
+                       }
                        if (gap_aux.marker > gap_new.marker) {
                                found = 1;
                                break;
                        if (gap_aux.marker > gap_new.marker) {
                                found = 1;
                                break;