Exit in case of write protected SD card

This commit is contained in:
fabio.olimpieri 2012-08-30 20:40:19 +00:00
parent a92b0a638c
commit 915d4ce996
3 changed files with 9 additions and 7 deletions

View File

@ -239,7 +239,7 @@ struct computer {
unsigned char FTPUser[32];
unsigned char FTPPwd[32];
unsigned char FTPPath[512];
unsigned char FTPIp[32];
unsigned char FTPIp[64];
unsigned char FTPPassive;
unsigned short FTPPort;
unsigned char autoconf;

View File

@ -1281,12 +1281,14 @@ int main(int argc,char *argv[]) {
FILE *f;
f=fopen("test4783.txt", "w");
if (f == NULL) {printf("Impossible to open file test4783.txt in w\n");write_protection=1;}
f=fopen("/test4783.txt", "w");
if (f == NULL) write_protection=1; //Impossible to open file
if (fclose(f)==EOF) {printf("Impossible to close file test4783.txt\n");write_protection=1;}
if (fclose(f)==EOF) write_protection=1; //Impossible to close file
unlink("test4783.txt");
if (write_protection) {msgInfo("SD card is write protected. Can't continue",3000,NULL);exit(0);}
unlink("/test4783.txt");
#endif

View File

@ -111,8 +111,8 @@ static const char *screen_messages[] = {
/*06*/ "Buffer resolution",
/*07*/ "^|640X480|320X240",
/*08*/ " ",
/*09*/ "576p video mode",
/*10*/ "^|on|off",
/*09 "576p video mode",*/
/*10 "^|on|off",*/
NULL
};