Improved portability
Merge pull request #60 from ichizok/improved-ptytty

Improved portability