diff options
author | Richard Purdie <rpurdie@linux.intel.com> | 2007-08-18 14:46:31 +0000 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2007-08-18 14:46:31 +0000 |
commit | 43d38a0d0bd4f45aeab1c4892bd6835e7cf51a0f (patch) | |
tree | fe7d38d2e249b28446a449abba047bc0bc39fb12 | |
parent | a52967b5cef67e5b5dabd955cb60495ba2a835f6 (diff) | |
download | bitbake-43d38a0d0bd4f45aeab1c4892bd6835e7cf51a0f.tar.gz |
cooker.py: Only try to change terminal flags on terminals
-rw-r--r-- | lib/bb/cooker.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py index 6ee6f07d4..0eda9eed9 100644 --- a/lib/bb/cooker.py +++ b/lib/bb/cooker.py @@ -76,12 +76,15 @@ class BBCooker: # # TOSTOP must not be set or our children will hang when they output # - import termios - tcattr = termios.tcgetattr(sys.stdout.fileno()) - if tcattr[3] & termios.TOSTOP: - bb.msg.note(1, bb.msg.domain.Build, "The terminal had the TOSTOP bit set, clearing...") - tcattr[3] = tcattr[3] & ~termios.TOSTOP - termios.tcsetattr(sys.stdout.fileno(), termios.TCSANOW, tcattr) + fd = sys.stdout.fileno() + if os.isatty(fd): + import termios + tcattr = termios.tcgetattr(fd) + if tcattr[3] & termios.TOSTOP: + bb.msg.note(1, bb.msg.domain.Build, "The terminal had the TOSTOP bit set, clearing...") + tcattr[3] = tcattr[3] & ~termios.TOSTOP + termios.tcsetattr(fd, termios.TCSANOW, tcattr) + def tryBuildPackage(self, fn, item, task, the_data, build_depends): """ |