forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

function stops app from exiting correctly [Resolved]

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
sturatt



Joined: 13 Jul 2006
Posts: 46

PostPosted: Fri Aug 04, 2006 3:39 pm    Post subject: function stops app from exiting correctly [Resolved] Reply with quote

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:

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
Back to top
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Fri Aug 04, 2006 5:19 pm    Post subject: Reply with quote

Try adding
memset(&plst, 0, sizeof plst);

That sometimes helps.

Jim
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
sturatt



Joined: 13 Jul 2006
Posts: 46

PostPosted: Sat Aug 05, 2006 1:11 am    Post subject: Reply with quote

turns out that memset was all it needed.. any idea why?
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Sat Aug 05, 2006 1:36 am    Post subject: Reply with quote

A bug in Sony's code.
_________________
Shoot Pixels Not People!
Makeshift Development
Back to top
View user's profile Send private message Visit poster's website
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Sat Aug 05, 2006 12:34 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group