ssh.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:ssha 作者: claranet 项目源码 文件源码
def run(command):
    child_pid = os.fork()
    if child_pid == 0:
        os.execlp(command[0], *command)
    else:
        while True:
            try:
                os.waitpid(child_pid, 0)
            except OSError as error:
                if error.errno == errno.ECHILD:
                    # No child processes.
                    # It has exited already.
                    break
                elif error.errno == errno.EINTR:
                    # Interrupted system call.
                    # This happens when resizing the terminal.
                    pass
                else:
                    # An actual error occurred.
                    raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号