Revision 28ce13d1

View differences:

mininet/util.py
91 91
        errDone = False
92 92
    while not outDone or not errDone:
93 93
        readable = poller.poll()
94
        for fd, _event in readable:
94
        for fd, event in readable:
95 95
            f = fdtofile[ fd ]
96
            data = f.read( 1024 )
97
            if echo:
98
                output( data )
99
            if f == popen.stdout:
100
                out += data
101
                if data == '':
96
            if event & POLLIN:
97
                data = f.read( 1024 )
98
                if echo:
99
                    output( data )
100
                if f == popen.stdout:
101
                    out += data
102
                    if data == '':
103
                        outDone = True
104
                elif f == popen.stderr:
105
                    err += data
106
                    if data == '':
107
                        errDone = True
108
            elif event & POLLHUP:
109
                if f == popen.stdout:
102 110
                    outDone = True
103
            elif f == popen.stderr:
104
                err += data
105
                if data == '':
111
                elif f == popen.stderr:
106 112
                    errDone = True
113
                poller.unregister( fd )
114

  
107 115
    returncode = popen.wait()
108 116
    return out, err, returncode
109 117

  

Also available in: Unified diff