nanogui@linuxhacker.org

nanogui@linuxhacker.org


Subject: cannot open shell in Microwindows Terminal
From: Masanori TOKUNAGA
Date: Thu, 19 Oct 2000 19:07:46 +0900


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 Masanori<mtokunag@nsc.mci.mei.co.jp>



nanogui@linuxhacker.org