Changeset 070479c830a0bb818bb628398b9d18934e4d393b

Show
Ignore:
Timestamp:
06/19/08 18:57:44 (4 years ago)
Author:
Lincoln de Sousa <lincoln@…>
Children:
6fda672b755bc70caa710143b30a84d60938589b
Parents:
c047c21fd33ccb1baca8957e9a32afb46e24f015
git-committer:
Lincoln de Sousa <lincoln@…> (06/19/08 18:57:44)
Message:

fixing tab deletion (when killing shell process) thanks to kov@… =)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/guake.py

    rc047c21 r070479c  
    10581058        """ 
    10591059        os.kill(pid, signal.SIGTERM) 
    1060         os.wait() 
    1061         sleep(3) 
    1062  
    1063         try: 
    1064             os.kill(pid, signal.SIGKILL) 
    1065         except OSError: 
    1066             # if this part of code was reached, means that SIGTERM did 
    1067             # the work and SIGKILL wasnt needed. 
    1068             pass 
     1060        num_tries = 30 
     1061 
     1062        while num_tries > 0: 
     1063            if os.waitpid(pid, os.WNOHANG)[0] != 0: 
     1064                break 
     1065            sleep(0.1) 
     1066            num_tries -= 1 
     1067 
     1068        if num_tries == 0: 
     1069            try: 
     1070                os.kill(pid, signal.SIGKILL) 
     1071                os.waitpid(pid, 0) 
     1072            except OSError: 
     1073                # if this part of code was reached, means that SIGTERM 
     1074                # did the work and SIGKILL wasnt needed. 
     1075                pass 
    10691076 
    10701077    def set_terminal_focus(self):