From 3694b738b883dec5b93f11d4025541af5f713482 Mon Sep 17 00:00:00 2001 From: rsc Date: Mon, 27 Dec 2004 00:38:00 +0000 Subject: handle pty correctly on linux --- src/cmd/9term/Linux.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/cmd') diff --git a/src/cmd/9term/Linux.c b/src/cmd/9term/Linux.c index eec79c28..a9bf6f9a 100644 --- a/src/cmd/9term/Linux.c +++ b/src/cmd/9term/Linux.c @@ -1 +1,15 @@ +#define getpts not_using_this_getpts #include "bsdpty.c" +#undef getpts + +int +getpts(int fd[], char *slave) +{ + if(openpty(&fd[1], &fd[0], NULL, NULL, NULL) >= 0){ + fchmod(fd[1], 0620); + strcpy(slave, ttyname(fd[0])); + return 0; + } + sysfatal("no ptys"); + return 0; +} -- cgit v1.2.3