1 set FD_CLOEXEC on listening socket
3 Skype4Py uses os.execlp() to spawn skype if it is not yet started, this leaks
4 our listening FD to skype process and can't get it back even if we ourself exit
7 and we can't startup again:
8 error: [Errno 98] Address already in use
10 Signed-off-by: Elan Ruusamäe <glen@delfi.ee>
11 Tested-by: Elan Ruusamäe <glen@delfi.ee>
12 --- bitlbee-3.0.5/protocols/skype/skyped.py~ 2012-04-15 12:42:34.110550155 +0300
13 +++ bitlbee-3.0.5/protocols/skype/skyped.py 2012-04-15 13:50:51.089559368 +0300
16 from ConfigParser import ConfigParser, NoOptionError
17 from traceback import print_exception
18 +from fcntl import fcntl, F_SETFD, FD_CLOEXEC
24 sock = socket.socket()
25 sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
26 + fcntl(sock, F_SETFD, FD_CLOEXEC);
27 sock.bind((host, port))
31 gobject.io_add_watch(sock, gobject.IO_IN, listener)