Completed ftp init conf, workround for mkdir

This commit is contained in:
fabio.olimpieri 2012-08-28 14:37:46 +00:00
parent edf251027e
commit a92b0a638c

View File

@ -77,7 +77,7 @@ char path_poke[2049];
char path_tmp[2049]; char path_tmp[2049];
unsigned int colors[80]; unsigned int colors[80];
unsigned int jump_frames,curr_frames; unsigned int jump_frames,curr_frames;
char *filenames[5];
static SDL_Surface *image; static SDL_Surface *image;
unsigned char usbismount = 0; unsigned char usbismount = 0;
@ -350,6 +350,7 @@ void load_rom(char type) {
char *retval; char *retval;
FILE *fichero; FILE *fichero;
int size; int size;
char *filenames[5];
switch(type) { switch(type) {
case 0: case 0:
@ -1019,7 +1020,7 @@ int load_config(struct computer *object, char *filename) {
if (rumble2<2) { if (rumble2<2) {
object->rumble[1]=rumble2; object->rumble[1]=rumble2;
} }
if (port<3) { if (port<4) {
object->port=port; object->port=port;
} }
if (autoconf<2) { if (autoconf<2) {
@ -1274,9 +1275,23 @@ int main(int argc,char *argv[]) {
if (!chdir(path_tmp)) remove_dir(path_tmp); //remove the tmp directory if it exists if (!chdir(path_tmp)) remove_dir(path_tmp); //remove the tmp directory if it exists
if (!mkdir(path_tmp,0777)){printf("Making tmp directory\n"); tmpismade=1;} int write_protection=0;
else {printf("Can't make tmp directory\n"); tmpismade=0;}
#ifdef GEKKO //Work arround until the bug in makdir of libogc is solved
FILE *f;
f=fopen("test4783.txt", "w");
if (f == NULL) {printf("Impossible to open file test4783.txt in w\n");write_protection=1;}
if (fclose(f)==EOF) {printf("Impossible to close file test4783.txt\n");write_protection=1;}
unlink("test4783.txt");
#endif
if ((!write_protection)&&(!mkdir(path_tmp,0777))){printf("Making tmp directory\n"); tmpismade=1;}
else {printf("Can't make tmp directory\n"); tmpismade=0;}
#ifdef GEKKO #ifdef GEKKO
if ((ordenador.port==1)&&usbismount) { if ((ordenador.port==1)&&usbismount) {
@ -1287,6 +1302,10 @@ int main(int argc,char *argv[]) {
strcpy(path_snaps,"smb:/"); strcpy(path_snaps,"smb:/");
strcpy(path_taps,"smb:/"); strcpy(path_taps,"smb:/");
} }
if ((ordenador.port==3)&&ftpismount) {
strcpy(path_snaps,"ftp:");
strcpy(path_taps,"ftp:");
}
#endif #endif
ordenador.current_tap[0]=0; ordenador.current_tap[0]=0;