Changeset c6b6537f4d82d799bb4ee6d4c8c1dc6b87c0542c

Show
Ignore:
Timestamp:
12/12/07 20:47:39 (9 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1197488859 +0000
git-parent:

[6c62642f455bfabd4a8c63fa6af0ee0d913ad703]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1197488859 +0000
Message:

Clear signal mask _between_ fork() and exec*().
Before fork() would break VLC's own sigmask.
After exec*() would rely on the children program to do it (and many don't).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/misc/screensaver.c

    rb8acb75 rc6b6537  
    135135static void Execute( intf_thread_t *p_this, const char *const *ppsz_args ) 
    136136{ 
    137     pid_t pid
    138     switch( pid = fork()
     137    pid_t pid = fork()
     138    switch( pid
    139139    { 
    140140        case 0:     /* we're the child */ 
     141        { 
     142            sigset_t set; 
     143            sigemptyset (&set); 
     144            pthread_sigmask (SIG_SETMASK, &set, NULL); 
     145 
    141146            /* We don't want output */ 
    142147            freopen( "/dev/null", "w", stdout ); 
     
    144149            execv( ppsz_args[0] , (char *const *)ppsz_args ); 
    145150            /* If the file we want to execute doesn't exist we exit() */ 
    146             exit( 1 ); 
    147             break; 
     151            exit( EXIT_FAILURE ); 
     152        } 
    148153        case -1:    /* we're the error */ 
    149154            msg_Dbg( p_this, "Couldn't fork() while launching %s", 
  • src/extras/libc.c

    r2578127 rc6b6537  
    954954 
    955955        case 0: 
     956        { 
     957            sigset_t set; 
     958            sigemptyset (&set); 
     959            pthread_sigmask (SIG_SETMASK, &set, NULL); 
     960 
    956961            /* NOTE: 
    957962             * Like it or not, close can fail (and not only with EBADF) 
     
    963968                execve (ppsz_argv[0], ppsz_argv, ppsz_env); 
    964969 
    965             exit (1); 
     970            exit (EXIT_FAILURE); 
     971        } 
    966972    } 
    967973