fixes for openbsd
This commit is contained in:
parent
2e65dc0d02
commit
dcba4bf6bd
2 changed files with 9 additions and 54 deletions
|
|
@ -1,59 +1,15 @@
|
||||||
#include <u.h>
|
#define getpts not_using_this_getpts
|
||||||
#include <sys/types.h>
|
#include "bsdpty.c"
|
||||||
#include <sys/ioctl.h>
|
#undef getpts
|
||||||
#include <termios.h>
|
|
||||||
#include <sys/termios.h>
|
|
||||||
#include <util.h>
|
|
||||||
#include <libc.h>
|
|
||||||
#include "term.h"
|
|
||||||
|
|
||||||
int
|
int
|
||||||
getpts(int fd[], char *slave)
|
getpts(int fd[], char *slave)
|
||||||
{
|
{
|
||||||
return openpty(&fd[1], &fd[0], slave, 0, 0);
|
if(openpty(&fd[1], &fd[0], NULL, NULL, NULL) >= 0){
|
||||||
}
|
fchmod(fd[1], 0620);
|
||||||
|
strcpy(slave, ttyname(fd[0]));
|
||||||
int
|
return 0;
|
||||||
childpty(int fd[], char *slave)
|
}
|
||||||
{
|
sysfatal("no ptys");
|
||||||
int sfd;
|
|
||||||
|
|
||||||
close(fd[1]);
|
|
||||||
setsid();
|
|
||||||
sfd = open(slave, ORDWR);
|
|
||||||
if(sfd < 0)
|
|
||||||
sysfatal("open %s: %r\n", slave);
|
|
||||||
if(ioctl(sfd, TIOCSCTTY, 0) < 0)
|
|
||||||
fprint(2, "ioctl TIOCSCTTY: %r\n");
|
|
||||||
return sfd;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct winsize ows;
|
|
||||||
|
|
||||||
void
|
|
||||||
updatewinsize(int row, int col, int dx, int dy)
|
|
||||||
{
|
|
||||||
struct winsize ws;
|
|
||||||
|
|
||||||
ws.ws_row = row;
|
|
||||||
ws.ws_col = col;
|
|
||||||
ws.ws_xpixel = dx;
|
|
||||||
ws.ws_ypixel = dy;
|
|
||||||
if(ws.ws_row != ows.ws_row || ws.ws_col != ows.ws_col)
|
|
||||||
if(ioctl(rcfd[0], TIOCSWINSZ, &ws) < 0)
|
|
||||||
fprint(2, "ioctl: %r\n");
|
|
||||||
ows = ws;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
israw(int fd)
|
|
||||||
{
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
setecho(int fd, int on)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ sys(char *buf, int devnull)
|
||||||
_exit(2);
|
_exit(2);
|
||||||
default:
|
default:
|
||||||
waitpid();
|
waitpid();
|
||||||
fprint(2, "done waiting\n");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue