src/joystick/bsd/SDL_sysjoystick.c
changeset 965 b68e551205e9
parent 776 18922ae3ee07
child 1185 58538e140e2d
equal deleted inserted replaced
964:d9209754ebee 965:b68e551205e9
   158 		if (SDL_SYS_JoystickOpen(&nj) == 0) {
   158 		if (SDL_SYS_JoystickOpen(&nj) == 0) {
   159 			SDL_SYS_JoystickClose(&nj);
   159 			SDL_SYS_JoystickClose(&nj);
   160 			SDL_numjoysticks++;
   160 			SDL_numjoysticks++;
   161 		} else {
   161 		} else {
   162 			free(joynames[nj.index]);
   162 			free(joynames[nj.index]);
       
   163 			joynames[nj.index] = NULL;
   163 		}
   164 		}
   164 	}
   165 	}
   165 	for (i = 0; i < MAX_JOY_JOYS; i++) {
   166 	for (i = 0; i < MAX_JOY_JOYS; i++) {
   166 		sprintf(s, "/dev/joy%d", i);
   167 		sprintf(s, "/dev/joy%d", i);
   167 		fd = open(s, O_RDONLY);
   168 		fd = open(s, O_RDONLY);