source: projects/specs/trunk/x/xorg-x11-xinit/xinit-1.3.4-client-session.patch @ 10989

Revision 10989, 1013 bytes checked in by iwaim, 7 years ago (diff)

xorg-x11-xinit: add flies

  • xinit-1.3.4/xinit.c

    old new char xserverrcbuf[256]; 
    8989 
    9090#define TRUE 1 
    9191#define FALSE 0 
     92#define ERR_EXIT 1 
    9293 
    9394static char *default_server = "X"; 
    9495static char *default_display = ":0";        /* choose most efficient */ 
    startClient(char *client_argv[]) 
    560561{ 
    561562    clientpid = fork(); 
    562563    if (clientpid == 0) { 
     564                int fd; 
    563565        set_environment(); 
    564566        setWindowPath(); 
    565567 
    startClient(char *client_argv[]) 
    567569            Error("cannot change uid"); 
    568570            _exit(EXIT_FAILURE); 
    569571        } 
    570         setpgid(0, getpid()); 
     572 
     573                fd = open ("/dev/null", O_RDONLY); 
     574 
     575                if (fd < 0) { 
     576                        Error("cannot open /dev/null: %s\n", strerror(errno)); 
     577                        _exit(ERR_EXIT); 
     578                } 
     579                close (STDIN_FILENO); 
     580                dup2 (fd, STDIN_FILENO); 
     581                close (fd); 
     582                setsid(); 
     583 
    571584        Execute(client_argv); 
    572585        Error("Unable to run program \"%s\"", client_argv[0]); 
    573586 
Note: See TracBrowser for help on using the repository browser.