[PD-dev] open_via_path() weirdness

IOhannes m zmoelnig zmoelnig at iem.at
Mon Apr 27 23:15:38 CEST 2009


hi all,

in the course of trying to find the filehandle-leak bug in Gem i found a 
weird problem with open_via_path().

can anybody find anything wrong with the attached code?
if not, try the attached patch as well.

everything works fine on linux, but on w32 i cannot close the 
file-handle anymore (i get an errno of EBADF, which means that fd isn't 
a valid open file descriptor).
which in turn results in a filehandle leak.

i notice that hardly anyone (esp. Pd itself) uses open_via_path().
is there a reason for that? is it buggy? (couldn't find anything wrong 
though)

i use it quite a lot, e.g. in [msgfile]; i guess nobody ever tried to 
open > 1000 files with msgfile on w32, so the error never appeared...


fgamsdr
IOhannes
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: findfile-test.pd
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20090427/e0e58b4f/attachment.asc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: findfile.c
Type: text/x-csrc
Size: 1473 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20090427/e0e58b4f/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3636 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20090427/e0e58b4f/attachment.bin>


More information about the Pd-dev mailing list