diff options
author | max99x <max99x@gmail.com> | 2011-08-27 05:33:23 +0300 |
---|---|---|
committer | max99x <max99x@gmail.com> | 2011-08-27 05:33:23 +0300 |
commit | 94501b32e968aabc32f3874a21362a428ee2a6d7 (patch) | |
tree | dbee0a8cede47b75cda542b6b6eed5d911ef41c5 | |
parent | 58de1ee09b3502125a149eb2b722db8609142d4e (diff) |
Made isatty() always fail. We don't support proper terminal control anyway.
-rw-r--r-- | src/library.js | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/library.js b/src/library.js index 61b3d3da..381f0991 100644 --- a/src/library.js +++ b/src/library.js @@ -1334,20 +1334,9 @@ LibraryManager.library = { isatty: function(fildes) { // int isatty(int fildes); // http://pubs.opengroup.org/onlinepubs/000095399/functions/isatty.html - if (FS.streams[fildes]) { - var object = FS.streams[fildes].object; - if (object.isDevice && object.input && object.output) { - // As far as we're concerned, a TTY is any device which supports both - // input and output. - return 0; - } else { - ___setErrNo(ERRNO_CODES.ENOTTY); - return -1; - } - } else { - ___setErrNo(ERRNO_CODES.EBADF); - return -1; - } + // For now it's easier to pretend we have no terminals. + ___setErrNo(FS.streams[fildes] ? ERRNO_CODES.ENOTTY : ERRNO_CODES.EBADF); + return -1; }, lchown__deps: ['chown'], lchown: function(path, owner, group) { |