Ticket #12486: trac_12486_fix_fd_leak.patch

File trac_12486_fix_fd_leak.patch, 650 bytes (added by vbraun, 9 years ago)

Initial patch

  • patchbot/patchbot.py

    # HG changeset patch
    # User Volker Braun <vbraun@stp.dias.ie>
    # Date 1341151631 -3600
    # Node ID c57ec20fd4088ee626850ed22a0a4beca6e662c9
    # Parent  50211ca2ff9222965e17cc8f1ef9fdaa6928cade
    Close all dup()'ed file descriptors
    
    diff --git a/patchbot/patchbot.py b/patchbot/patchbot.py
    a b  
    168168        time.sleep(1)
    169169        os.dup2(self._saved[0], sys.stdout.fileno())
    170170        os.dup2(self._saved[1], sys.stderr.fileno())
     171        os.close(self._saved[0])
     172        os.close(self._saved[1])
    171173        time.sleep(1)
    172174        try:
    173175            signal.signal(signal.SIGALRM, alarm_handler)