Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(121)

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc

Issue 59883020: [NaCl SDK] nacl_io: Enable isatty running under sel_ldr. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "nacl_io/kernel_proxy.h" 5 #include "nacl_io/kernel_proxy.h"
6 6
7 #include <assert.h> 7 #include <assert.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <limits.h> 10 #include <limits.h>
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
569 int KernelProxy::fdatasync(int fd) { 569 int KernelProxy::fdatasync(int fd) {
570 errno = ENOSYS; 570 errno = ENOSYS;
571 return -1; 571 return -1;
572 } 572 }
573 573
574 int KernelProxy::isatty(int fd) { 574 int KernelProxy::isatty(int fd) {
575 ScopedKernelHandle handle; 575 ScopedKernelHandle handle;
576 Error error = AcquireHandle(fd, &handle); 576 Error error = AcquireHandle(fd, &handle);
577 if (error) { 577 if (error) {
578 errno = error; 578 errno = error;
579 return -1; 579 return 0;
580 } 580 }
581 581
582 error = handle->node()->IsaTTY(); 582 error = handle->node()->Isatty();
583 if (error) { 583 if (error) {
584 errno = error; 584 errno = error;
585 return -1; 585 return 0;
586 } 586 }
587 587
588 return 0; 588 return 1;
589 } 589 }
590 590
591 int KernelProxy::ioctl(int fd, int request, va_list args) { 591 int KernelProxy::ioctl(int fd, int request, va_list args) {
592 ScopedKernelHandle handle; 592 ScopedKernelHandle handle;
593 Error error = AcquireHandle(fd, &handle); 593 Error error = AcquireHandle(fd, &handle);
594 if (error) { 594 if (error) {
595 errno = error; 595 errno = error;
596 return -1; 596 return -1;
597 } 597 }
598 598
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 errno = ENOTSOCK; 1629 errno = ENOTSOCK;
1630 return -1; 1630 return -1;
1631 } 1631 }
1632 1632
1633 return 0; 1633 return 0;
1634 } 1634 }
1635 1635
1636 #endif // PROVIDES_SOCKET_API 1636 #endif // PROVIDES_SOCKET_API
1637 1637
1638 } // namespace_nacl_io 1638 } // namespace_nacl_io
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698