aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9term
diff options
context:
space:
mode:
authorPetter Rodhelind <petter.rodhelind@gmail.com>2019-01-07 21:48:38 +0100
committerPetter Rodhelind <petter.rodhelind@gmail.com>2019-01-07 21:48:38 +0100
commit98222694f92aeecfcbb216fd1cb835b9550aa6d6 (patch)
tree94f06e87ee4eb2145b46be89db141d82507c630d /src/cmd/9term
parentd95f1bcc4938b3b0b7f832b67575e07a87095721 (diff)
parent2607cc565ee3d5facb8949e9acfed35c8ae300c9 (diff)
downloadplan9port-98222694f92aeecfcbb216fd1cb835b9550aa6d6.tar.gz
plan9port-98222694f92aeecfcbb216fd1cb835b9550aa6d6.tar.bz2
plan9port-98222694f92aeecfcbb216fd1cb835b9550aa6d6.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/cmd/9term')
-rw-r--r--src/cmd/9term/FreeBSD.c16
-rw-r--r--src/cmd/9term/rcstart.c7
2 files changed, 22 insertions, 1 deletions
diff --git a/src/cmd/9term/FreeBSD.c b/src/cmd/9term/FreeBSD.c
index eec79c28..e91f6ace 100644
--- a/src/cmd/9term/FreeBSD.c
+++ b/src/cmd/9term/FreeBSD.c
@@ -1 +1,17 @@
+#define getpts not_using_this_getpts
#include "bsdpty.c"
+#undef getpts
+
+#include <libutil.h>
+
+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;
+}
diff --git a/src/cmd/9term/rcstart.c b/src/cmd/9term/rcstart.c
index 141b9b00..fddabc6d 100644
--- a/src/cmd/9term/rcstart.c
+++ b/src/cmd/9term/rcstart.c
@@ -34,7 +34,7 @@ int
rcstart(int argc, char **argv, int *pfd, int *tfd)
{
int fd[2], i, pid;
- char *cmd, *xargv[3];
+ char *cmd, *xargv[4];
char slave[256];
int sfd;
@@ -46,6 +46,11 @@ rcstart(int argc, char **argv, int *pfd, int *tfd)
argv[0] = "rc";
argv[1] = "-i";
argv[2] = 0;
+ if(loginshell){
+ argv[2] = "-l";
+ argv[3] = 0;
+ argc = 3;
+ }
}
cmd = argv[0];
if(loginshell){