From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Nov 20 10:20:09 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB81D1065694 for ; Sat, 20 Nov 2010 10:20:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8F9AB8FC33 for ; Sat, 20 Nov 2010 10:20:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id oAKAK97x064013 for ; Sat, 20 Nov 2010 10:20:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id oAKAK9kI064007; Sat, 20 Nov 2010 10:20:09 GMT (envelope-from gnats) Date: Sat, 20 Nov 2010 10:20:09 GMT Message-Id: <201011201020.oAKAK9kI064007@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: Martin Birgmeier Cc: Subject: Re: ports/152412: compiling multimedia/vlc-1.1.5, 3 fails on FreeBSD 7.3 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Martin Birgmeier List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 20 Nov 2010 10:20:09 -0000 The following reply was made to PR ports/152412; it has been noted by GNATS. From: Martin Birgmeier To: bug-followup@FreeBSD.org Cc: Subject: Re: ports/152412: compiling multimedia/vlc-1.1.5,3 fails on FreeBSD 7.3 Date: Sat, 20 Nov 2010 11:13:33 +0100 This is a multi-part message in MIME format. --------------040708010500060709090505 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Here is a patch which seems to work, derived from running "git diff 2a817cdbc2cd282b353cace71a8cd603d8151893 860a707fa6b05eb59ee15da833af7d655176ff65" on the vlc git repository. It extends and replaces the patch already present in multimedia/vlc/files. Regards, Martin --------------040708010500060709090505 Content-Type: text/plain; name="extra-patch-modules__misc__inhibit__xscreensaver.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="extra-patch-modules__misc__inhibit__xscreensaver.c" --- ./modules/misc/inhibit/xscreensaver.c.ORIG 2010-04-13 02:22:27.000000000 +0200 +++ ./modules/misc/inhibit/xscreensaver.c 2010-11-20 10:28:58.000000000 +0100 @@ -39,7 +39,6 @@ #include #include #include -#include /***************************************************************************** * Local prototypes @@ -53,13 +52,8 @@ struct vlc_inhibit_sys { vlc_timer_t timer; - posix_spawn_file_actions_t actions; - posix_spawnattr_t attr; - int nullfd; }; -extern char **environ; - /***************************************************************************** * Module descriptor *****************************************************************************/ @@ -88,21 +82,6 @@ } p_ih->inhibit = Inhibit; - int fd = vlc_open ("/dev/null", O_WRONLY); - posix_spawn_file_actions_init (&p_sys->actions); - if (fd != -1) - { - posix_spawn_file_actions_adddup2 (&p_sys->actions, fd, 1); - posix_spawn_file_actions_adddup2 (&p_sys->actions, fd, 2); - posix_spawn_file_actions_addclose (&p_sys->actions, fd); - } - p_sys->nullfd = fd; - - sigset_t set; - posix_spawnattr_init (&p_sys->attr); - sigemptyset (&set); - posix_spawnattr_setsigmask (&p_sys->attr, &set); - return VLC_SUCCESS; } @@ -115,10 +94,6 @@ vlc_inhibit_sys_t *p_sys = p_ih->p_sys; vlc_timer_destroy( p_sys->timer ); - if (p_sys->nullfd != -1) - close (p_sys->nullfd); - posix_spawnattr_destroy (&p_sys->attr); - posix_spawn_file_actions_destroy (&p_sys->actions); free( p_sys ); } @@ -131,15 +106,33 @@ /***************************************************************************** * Execute: Spawns a process using execv() *****************************************************************************/ -static void Execute (vlc_inhibit_t *p_ih, const char *const *argv) +static void Execute( vlc_inhibit_t *p_ih, const char *const *ppsz_args ) { - vlc_inhibit_sys_t *p_sys = p_ih->p_sys; - pid_t pid; - - if (posix_spawnp (&pid, argv[0], &p_sys->actions, &p_sys->attr, - (char **)argv, environ) == 0) + pid_t pid = fork(); + switch( pid ) { - while (waitpid (pid, NULL, 0) != pid); + case 0: /* we're the child */ + { + sigset_t set; + sigemptyset (&set); + pthread_sigmask (SIG_SETMASK, &set, NULL); + + /* We don't want output */ + if( ( freopen( "/dev/null", "w", stdout ) != NULL ) + && ( freopen( "/dev/null", "w", stderr ) != NULL ) ) + execv( ppsz_args[0] , (char *const *)ppsz_args ); + /* If the file we want to execute doesn't exist we exit() */ + exit( EXIT_FAILURE ); + } + case -1: /* we're the error */ + msg_Dbg( p_ih, "Couldn't fork() while launching %s", + ppsz_args[0] ); + break; + default: /* we're the parent */ + /* Wait for the child to exit. + * We will not deadlock because we ran "/bin/sh &" */ + while( waitpid( pid, NULL, 0 ) != pid); + break; } } --------------040708010500060709090505--