Branch: Tag:

1997-05-07

1997-05-07 05:11:56 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Now closes the input and output pipes after dup2.

Rev: lib/modules/Process.pmod:1.6

34:    {    return pid;    }else{ -  if(stdin) +  if(stdin) {    stdin->dup2(File("stdin")); -  +  stdin->close(); +  }    -  if(stdout) +  if(stdout) {    stdout->dup2(File("stdout")); -  +  stdout->close(); +  }    -  if(stderr) +  if(stderr) {    stderr->dup2(File("stderr")); -  +  stderr->close(); +  } +  ::close();    exec("/bin/sh","-c",s);    exit(69);    }
56:    p=file::pipe();    if(!p) error("Popen failed. (couldn't create pipe)\n");    spawn(s,0,p,0); +  p->close();    destruct(p);       t=read(0x7fffffff);