nanogui: cannot open shell in Microwindows Terminal
Subject:
cannot open shell in Microwindows Terminal
From:
Masanori TOKUNAGA ####@####.####
Date:
19 Oct 2000 10:04:06 -0000
Message-Id: <39EEC7F2.ACF8F66C@nsc.mci.mei.co.jp>
Hi
I try to excute demo 'mterm' on SuperH processor.
Microwindows Terminal is opened and but I failed to open shell..
It seems that it stops in "close(STDERR_FILENO);" .
What do I have to check ?
>demos/mwin/mterm.c
/*
* Create a shell running through a pseudo tty, return the shell fd.
*/
int
CreatePtyShell(void)
{
int n = 0;
int tfd;
char pty_name[12];
char * argv[2];
again:
sprintf(pty_name, "/dev/ptyp%d", n);
if ((tfd = open(pty_name, O_RDWR | O_NONBLOCK)) < 0) {
if ((errno == EBUSY || errno == EIO) && n < 10) {
++n;
goto again;
}
fprintf(stderr, "Can't create pty %s\n", pty_name);
return -1;
}
signal(SIGCHLD, ptysignaled);
signal(SIGINT, ptysignaled);
if ((pid = fork()) == -1) {
fprintf(stderr, "No processes\n");
return -1;
}
if (!pid) {
close(STDIN_FILENO);
close(STDOUT_FILENO);
close(STDERR_FILENO); << ---- stop here
close(tfd);
--
TOKUNAGA ####@####.####