Problem with fioDclose()?

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Problem with fioDclose()?

Post by ooPo »

In testing ps2client, I've come across a problem where I can't close a directory I've opened. Here's the log:
[*] TESTING DIRECTORY ACCESS
dopen name host:TEST
[REQ] BABE0161
[OPENDIR] TEST = -1209704440
dopen fd = -1209704440
[*] fioDopen('host:TEST') = -1209704440
[*] fioDclose(-1209704440) = -9
You can see when I fioDopen, the client receives request BABE0161, which is opendir. Then when I send fioDclose, it returns -9 without ever closedir sending a request to the client. I should be seeing BABE0171.

Here's what pksh fresh out of cvs sees:
log: [*] TESTING DIRECTORY ACCESS
log: dopen name host:TEST
log: dopen fd = -1209831416
log: [*] fioDopen('host:TEST') = -1209831416
log: [*] fioDclose(-1209831416) = -9
Any ideas? I figure it has to be in ps2link or ps2sdk somewhere, but I haven't come across any strange bugs in the code that stick out. Perhaps the fio code on the iop checks the fd before passing it on, rejecting it because it is below zero?

Hmm, perhaps making it an unsigned int instead will get it to send the request.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

When I send a fake number, it sends through just fine...
[*] TESTING DIRECTORY ACCESS
dopen name host:TEST
[REQ] BABE0161
[OPENDIR] TEST = 2
dopen fd = 2
[*] fioDopen('host:TEST') = 2
[REQ] BABE0171
[CLOSEDIR] 2 = 0
[*] fioDclose(2) = 2
Looks like I'll be keeping an array of DIR structures client-side and sending just the index into that array. Oh well.
Post Reply