If dosfsck is run in read-only mode (-n), exit with code 0

if the only issue found is an uninitialized free cluster summary.

Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
This commit is contained in:
Steven J. Magnani 2010-01-21 16:56:26 +01:00 committed by Daniel Baumann
parent 1cae726e2d
commit bbb25bf11a
4 changed files with 12 additions and 10 deletions

View File

@ -42,7 +42,7 @@
#include "check.h"
int interactive = 0,list = 0,test = 0,verbose = 0,write_immed = 0;
int interactive = 0,rw = 0,list = 0,test = 0,verbose = 0,write_immed = 0;
int atari_format = 0;
unsigned n_files = 0;
void *mem_queue = NULL;
@ -102,7 +102,7 @@ static void check_atari( void )
int main(int argc,char **argv)
{
DOS_FS fs;
int rw,salvage_files,verify,c;
int salvage_files,verify,c;
unsigned n_files_check=0, n_files_verify=0;
unsigned long free_clusters;

View File

@ -189,7 +189,7 @@ typedef struct {
#define offsetof(t,e) ((int)&(((t *)0)->e))
#endif
extern int interactive,list,verbose,test,write_immed;
extern int interactive,rw,list,verbose,test,write_immed;
extern int atari_format;
extern unsigned n_files;
extern void *mem_queue;

View File

@ -39,7 +39,7 @@
#include "check.h"
int interactive = 0,list = 0,test = 0,verbose = 0,write_immed = 0;
int interactive = 0,rw = 0,list = 0,test = 0,verbose = 0,write_immed = 0;
int atari_format = 0;
unsigned n_files = 0;
void *mem_queue = NULL;
@ -86,7 +86,7 @@ static void check_atari( void )
int main(int argc, char *argv[])
{
DOS_FS fs;
int rw = 0;
rw = 0;
char *device = NULL;
char *label = NULL;

View File

@ -538,12 +538,14 @@ unsigned long update_free(DOS_FS *fs)
}
else {
printf( "Free cluster summary uninitialized (should be %ld)\n", free );
if (rw) {
if (interactive)
printf( "1) Set it\n2) Leave it uninitialized\n" );
else printf( " Auto-setting.\n" );
if (!interactive || get_key("12","?") == '1')
do_set = 1;
}
}
if (do_set) {
unsigned long le_free = CT_LE_L(free);