@@ -118,52 +118,28 @@ void read_fat(DOS_FS * fs)
118118 second_ok = (second_media .value & FAT_EXTD (fs )) == FAT_EXTD (fs );
119119 if (first_ok && !second_ok ) {
120120 printf ("FATs differ - using first FAT.\n" );
121- #ifdef __REACTOS__
122- if (rw )
123- fs_write (fs -> fat_start + fs -> fat_size , eff_size , first );
124- #else
121+
125122 fs_write (fs -> fat_start + fs -> fat_size , eff_size , first );
126- #endif
127123 }
128124 if (!first_ok && second_ok ) {
129125 printf ("FATs differ - using second FAT.\n" );
130- #ifdef __REACTOS__
131- if (rw )
132- fs_write (fs -> fat_start , eff_size , second );
133- #else
134126 fs_write (fs -> fat_start , eff_size , second );
135- #endif
136127 memcpy (first , second , eff_size );
137128 }
138129 if (first_ok && second_ok ) {
139130 if (interactive ) {
140131 printf ("FATs differ but appear to be intact. Use which FAT ?\n"
141132 "1) Use first FAT\n2) Use second FAT\n" );
142133 if (get_key ("12" , "?" ) == '1' ) {
143- #ifdef __REACTOS__
144- if (rw )
145- fs_write (fs -> fat_start + fs -> fat_size , eff_size , first );
146- #else
147134 fs_write (fs -> fat_start + fs -> fat_size , eff_size , first );
148- #endif
149135 } else {
150- #ifdef __REACTOS__
151- if (rw )
152- fs_write (fs -> fat_start , eff_size , second );
153- #else
154136 fs_write (fs -> fat_start , eff_size , second );
155- #endif
156137 memcpy (first , second , eff_size );
157138 }
158139 } else {
159140 printf ("FATs differ but appear to be intact. Using first "
160141 "FAT.\n" );
161- #ifdef __REACTOS__
162- if (rw )
163- fs_write (fs -> fat_start + fs -> fat_size , eff_size , first );
164- #else
165142 fs_write (fs -> fat_start + fs -> fat_size , eff_size , first );
166- #endif
167143 }
168144 }
169145 if (!first_ok && !second_ok ) {
@@ -274,17 +250,10 @@ void set_fat(DOS_FS * fs, uint32_t cluster, int32_t new)
274250 default :
275251 die ("Bad FAT entry size: %d bits." , fs -> fat_bits );
276252 }
277- #ifdef __REACTOS__
278- if (rw )
279- {
280- #endif
281253 fs_write (offs , size , data );
282254 if (fs -> nfats > 1 ) {
283255 fs_write (offs + fs -> fat_size , size , data );
284256 }
285- #ifdef __REACTOS__
286- }
287- #endif
288257}
289258
290259int bad_cluster (DOS_FS * fs , uint32_t cluster )
@@ -546,12 +515,7 @@ void reclaim_file(DOS_FS * fs)
546515 de .size = htole32 (le32toh (de .size ) + fs -> cluster_size );
547516 reclaimed ++ ;
548517 }
549- #ifdef __REACTOS__
550- if (rw )
551- fs_write (offset , sizeof (DIR_ENT ), & de );
552- #else
553518 fs_write (offset , sizeof (DIR_ENT ), & de );
554- #endif
555519 }
556520 if (reclaimed )
557521 printf ("Reclaimed %d unused cluster%s (%llu bytes) in %d chain%s.\n" ,
@@ -593,10 +557,8 @@ uint32_t update_free(DOS_FS * fs)
593557 else
594558#ifdef __REACTOS__
595559 if (rw )
596- printf (" Auto-correcting.\n" );
597- #else
598- printf (" Auto-correcting.\n" );
599560#endif
561+ printf (" Auto-correcting.\n" );
600562#ifndef __REACTOS__
601563 if (!interactive || get_key ("12" , "?" ) == '1' )
602564#else
@@ -619,14 +581,6 @@ uint32_t update_free(DOS_FS * fs)
619581 if (do_set ) {
620582 uint32_t le_free = htole32 (free );
621583 fs -> free_clusters = free ;
622- #ifdef __REACTOS__
623- if (rw )
624- fs_write (fs -> fsinfo_start + offsetof(struct info_sector , free_clusters ),
625- sizeof (le_free ), & le_free );
626- #else
627- fs_write (fs -> fsinfo_start + offsetof(struct info_sector , free_clusters ),
628- sizeof (le_free ), & le_free );
629- #endif
630584 fs_write (fs -> fsinfo_start + offsetof(struct info_sector , free_clusters ),
631585 sizeof (le_free ), & le_free );
632586 }
0 commit comments