beep file descriptors not being closed
Andy Walshe <[email protected]> Wed, 18 Dec 2002 18:23:23 +0000
| Newsgroups | gmane.network.beep.beepcore.c.general |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I have found an issue regarding file descriptors in beep.
The beepd listener makes a call to accept() and a corresponding
call to close() is not made for the file descriptor.
The problem can be seen by running the example programs as follows:
1. start the beepd listener as follows:
>> truss -o truss.out -t open,creat,close,so_socket,accept
beepd -f beepd.cfg
2. run the sample initiator beepng. e.g.
>> beepng -a testing -f beepng.cfg -m echo -p 10289 server_name
3. tail the output file in another window
>> tail -f truss.out
You will see something like the following (if you run the sample
initiator 4 times)
......
open("/usr/local/lib/libnull-profiles.so", O_RDONLY) Err#2 ENOENT
open("/usr/local/lib/python2.2/libnull-profiles.so", O_RDONLY) Err#2
ENOENT
open("/vobs/3p/openssl-0.9.6g/lib/libnull-profiles.so", O_RDONLY) Err#2
ENOENT
open("/vobs/3p/beepcore-c-0.2/Release/lib/libnull-profiles.so",
O_RDONLY) = 5
close(5) = 0
so_socket(2, 2, 0, "", 1) = 5
accept(5, 0x00000000, 0x00000000, 1) = 6
accept(5, 0x00000000, 0x00000000, 1) = 7
accept(5, 0x00000000, 0x00000000, 1) = 8
accept(5, 0x00000000, 0x00000000, 1) = 9
I had a go at closing the file descriptor in pro_close_confirmation()
in my profile but this hung the listener (it seems it still uses the
file descriptor).
I presume the beepcore-c library should close this fd and am
investigating it but ain't too familiar with the code. Any pointers
or solutions appreciated.
Andy
-------------------------------------------------------
This SF.NET email is sponsored by: Order your Holiday Geek Presents Now!
Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap,
MP3 Players, XBox Games, Flying Saucers, WebCams, Smart Putty.
T H I N K G E E K . C O M http://www.thinkgeek.com/sf/