symbolize.py: fix exception when stdin is not a terminal

Commit 6b4fc6752b3c ("symbolize.py: disable terminal local echo") uses
termios functions on stdin unconditionally. Unfortunately, this will
cause an exception when stdin is not a terminal, for instance:

 $ echo Hello | ./script/symbolize.py
 Traceback (most recent call last):
   File "./scripts/symbolize.py", line 497, in <module>
     main()
   File "./scripts/symbolize.py", line 484, in main
     old = termios.tcgetattr(fd)
 termios.error: (25, 'Inappropriate ioctl for device')

Fix the issue by making sure stdin is a TTY before using the termios
functions.

Fixes: 6b4fc6752b3c ("symbolize.py: disable terminal local echo")
Signed-off-by: Jerome Forissier <jerome@forissier.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
1 file changed
tree: 9e9c9e37f555973a96479ae2449e868abbccb145
  1. .github/
  2. core/
  3. keys/
  4. ldelf/
  5. lib/
  6. mk/
  7. scripts/
  8. ta/
  9. .gitignore
  10. .shippable.yml
  11. .travis.yml
  12. CHANGELOG.md
  13. LICENSE
  14. MAINTAINERS
  15. Makefile
  16. README.md
  17. typedefs.checkpatch
README.md

OP-TEE Trusted OS

This git contains source code for the secure side implementation of OP-TEE project.

All official OP-TEE documentation has moved to http://optee.readthedocs.io.

// OP-TEE core maintainers