]> git.pld-linux.org Git - packages/bitlbee.git/blame - skyped-FD_CLOEXEC.patch
skyped: allow override builtin Skype4Py transport
[packages/bitlbee.git] / skyped-FD_CLOEXEC.patch
CommitLineData
c35d504c
ER
1set FD_CLOEXEC on listening socket
2
3Skype4Py uses os.execlp() to spawn skype if it is not yet started, this leaks
4our listening FD to skype process and can't get it back even if we ourself exit
5meanwhile.
6
7and we can't startup again:
8error: [Errno 98] Address already in use
9
10Signed-off-by: Elan Ruusamäe <glen@delfi.ee>
11Tested-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
14@@ -31,6 +31,7 @@
15 import hashlib
16 from ConfigParser import ConfigParser, NoOptionError
17 from traceback import print_exception
18+from fcntl import fcntl, F_SETFD, FD_CLOEXEC
19 import ssl
20
21 __version__ = "0.1.1"
22@@ -184,8 +185,10 @@
23 else:
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))
28 sock.listen(1)
29+
30 if hasgobject:
31 gobject.io_add_watch(sock, gobject.IO_IN, listener)
32 else:
This page took 0.027895 seconds and 4 git commands to generate.