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