Angus Lees 9b56ef34f7 Just use {0,1,2} rather sys.std*.fileno()
Sometimes sys.std* have been monkeypatched to something other than real
filehandles, and the fileno() method may be missing or return a
misleading value (eg: during test cases).

This change just hard codes the real 0/1/2 file descriptor numbers
rather than trying to find another more stable symbolic name - the
values are well known and as portable as the os.dup2() call being used.

Strongly related to this, this change also moves the relevant flush()
calls before any fork/dup2 funny business, to ensure python buffers are
flushed and only the expected data hits the fds.

Change-Id: I635b3a6a7413ea85d0eac55d9a6e1dbc7402376f
2015-06-25 09:35:55 +10:00
..
2015-03-12 11:22:56 +01:00
2015-03-12 11:22:56 +01:00
2015-06-25 09:35:55 +10:00
2015-05-11 16:09:51 +02:00
2015-03-12 11:22:56 +01:00
2014-06-21 15:07:31 +08:00