Changeset 9ce44dd for protocols/skype


Ignore:
Timestamp:
2012-04-22T21:48:09Z (9 years ago)
Author:
Miklos Vajna <vmiklos@…>
Branches:
master
Children:
3c88759
Parents:
e93fa05
Message:

skyped: 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

Patch-by: Elan Ruusamäe <glen@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/skype/skyped.py

    re93fa05 r9ce44dd  
    3232from ConfigParser import ConfigParser, NoOptionError
    3333from traceback import print_exception
     34from fcntl import fcntl, F_SETFD, FD_CLOEXEC
    3435import ssl
    3536
     
    185186                sock = socket.socket()
    186187        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
     188        fcntl(sock, F_SETFD, FD_CLOEXEC);
    187189        sock.bind((host, port))
    188190        sock.listen(1)
     191
    189192        if hasgobject:
    190193                gobject.io_add_watch(sock, gobject.IO_IN, listener)
Note: See TracChangeset for help on using the changeset viewer.