summaryrefslogtreecommitdiffhomepage
path: root/test/util/pty_util.cc
diff options
context:
space:
mode:
authorAyush Ranjan <ayushranjan@google.com>2020-09-01 14:41:54 -0700
committergVisor bot <gvisor-bot@google.com>2020-09-01 14:43:41 -0700
commit2eaf54dd597d8aaa56ad6274e0c1e585d9b9c063 (patch)
tree040952f2e711bdc4664b90de967e1a0c31d9c75c /test/util/pty_util.cc
parent04c284f8c2015b801c929325a6304e601eb94e56 (diff)
Refactor tty codebase to use master-replica terminology.
Updates #2972 PiperOrigin-RevId: 329584905
Diffstat (limited to 'test/util/pty_util.cc')
-rw-r--r--test/util/pty_util.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/util/pty_util.cc b/test/util/pty_util.cc
index 5fa622922..2cf0bea74 100644
--- a/test/util/pty_util.cc
+++ b/test/util/pty_util.cc
@@ -23,25 +23,25 @@
namespace gvisor {
namespace testing {
-PosixErrorOr<FileDescriptor> OpenReplica(const FileDescriptor& main) {
- PosixErrorOr<int> n = ReplicaID(main);
+PosixErrorOr<FileDescriptor> OpenReplica(const FileDescriptor& master) {
+ PosixErrorOr<int> n = ReplicaID(master);
if (!n.ok()) {
return PosixErrorOr<FileDescriptor>(n.error());
}
return Open(absl::StrCat("/dev/pts/", n.ValueOrDie()), O_RDWR | O_NONBLOCK);
}
-PosixErrorOr<int> ReplicaID(const FileDescriptor& main) {
+PosixErrorOr<int> ReplicaID(const FileDescriptor& master) {
// Get pty index.
int n;
- int ret = ioctl(main.get(), TIOCGPTN, &n);
+ int ret = ioctl(master.get(), TIOCGPTN, &n);
if (ret < 0) {
return PosixError(errno, "ioctl(TIOCGPTN) failed");
}
// Unlock pts.
int unlock = 0;
- ret = ioctl(main.get(), TIOCSPTLCK, &unlock);
+ ret = ioctl(master.get(), TIOCSPTLCK, &unlock);
if (ret < 0) {
return PosixError(errno, "ioctl(TIOSPTLCK) failed");
}