Discuss the development of new homebrew software, tools and libraries.
	Moderators:  cheriff , TyRaNiD 
			
		
		
			
				
																			
								sturatt 							 
									
		Posts:  46 Joined:  Thu Jul 13, 2006 4:21 pm 
		
						
					
													
							
						
									
						Post 
					 
								by sturatt  Fri Aug 04, 2006 3:39 pm 
			
			
			
			
			This is pretty weird, if i dont call this function, my app closes fine, but when i do, it freezes on exit... i dont get it
Code: Select all 
void openPl()
{
    printf("Test\n");
    sceKernelDelayThread(1000000);
    struct SceIoDirent plst;
    int fd = sceIoDopen("./pl/");
    printf("Test2\n");
    sceKernelDelayThread(1000000);
    printf("sceIoDopen worked\n");
    sceKernelDelayThread(1000000);
    char pl_array[50][100];
    int pl_counter = 0;
    int pl_low = 0;
    int pl_high = 12;
    int pl_selected = 0;
    int pl_temp;
    int pl_x = 95, pl_y = 82;
    printf("initialization worked\n");
    if (fd >= 0)
    {
        printf("fd = %i\n", fd);
        sceKernelDelayThread(1000000);
        sceIoDread(fd, &plst);
        printf("%s\n", plst.d_name);
        sceKernelDelayThread(1000000);
    }
    sceIoDclose(fd);
}
commenting out the sceIoDread solves the problem. I'm using sceIoDread and sceIoDopen in other parts of the program... why is it being fussy here?
					Last edited by 
sturatt  on Sat Aug 05, 2006 1:46 am, edited 1 time in total.
									
 
		 
				
		
		 
	 
				
		
		
			
				
								Jim 							 
									
		Posts:  476 Joined:  Sat Jul 02, 2005 10:06 pmLocation:  Sydney
				Contact: 
				
			 
				
		 
		
						
					
						 
													
							
						
									
						Post 
					 
								by Jim  Fri Aug 04, 2006 5:19 pm 
			
			
			
			
			Try adding
			
			
									
									
						 
		 
				
		
		 
	 
				
		
		
			
				
																			
								sturatt 							 
									
		Posts:  46 Joined:  Thu Jul 13, 2006 4:21 pm 
		
						
					
						 
													
							
						
									
						Post 
					 
								by sturatt  Sat Aug 05, 2006 1:11 am 
			
			
			
			
			turns out that memset was all it needed.. any idea why?
			
			
									
									
						 
		 
				
		
		 
	 
				
		
		
			
				
								Drakonite 							 
						Site Admin 			
		Posts:  990 Joined:  Sat Jan 17, 2004 1:30 am
				Contact: 
				
			 
				
		 
		
						
					
						 
													
							
						
									
						Post 
					 
								by Drakonite  Sat Aug 05, 2006 1:36 am 
			
			
			
			
			A bug in Sony's code.
			
			
									
									
						 
		 
				
		
		 
	 
				
		
		
			
				
																			
								jimparis 							 
									
		Posts:  1145 Joined:  Fri Jun 10, 2005 4:21 amLocation:  Boston 
		
						
					
						 
													
							
						
									
						Post 
					 
								by jimparis  Sat Aug 05, 2006 12:34 pm 
			
			
			
			
			Unless you have a particular reason not to, I'd suggest sticking with newlib functions like opendir() readdir() etc. because we've already found and worked around these sort of issues.