Re: g_coprocess()



Owen Taylor <otaylor@gtk.org> writes:

| The main thing to watch out for is to use _exit() instead
| of exit() in the child, so the child doesn't try to clean
| up the parent's X connection.

But this requires the child to know about the parent. I can not
guaranty this, when I want to start any child program. Isn't there a
way to detach all the X stuff from the child?

  if (fork () == 0)
    {
      close (in_fd[1]);
      close (out_fd[0]);
      
      dup2 (in_fd[0], STDIN_FILENO);
      dup2 (out_fd[1], STDOUT_FILENO);

      gtk_exit_child ();

      execlp ("child", NULL);
    }

What has to be done to get rid of all X connections?

-- 
http://www.ping.de/sites/aibon/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]