* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <vlc/vlc.h>
#include <ctype.h>
# include <dirent.h>
#endif
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
+
#ifdef HAVE_FORK
# include <sys/time.h>
# include <unistd.h>
/*****************************************************************************
* lldiv: returns quotient and remainder
*****************************************************************************/
-#if defined(SYS_BEOS) \
- || (defined (__FreeBSD__) && (__FreeBSD__ < 5))
+#if !defined( HAVE_LLDIV )
lldiv_t vlc_lldiv( long long numer, long long denom )
{
lldiv_t d;
_WDIR *p_real_dir;
int i_drives;
struct _wdirent dd_dir;
- vlc_bool_t b_insert_back;
+ bool b_insert_back;
} vlc_DIR;
void *vlc_wopendir( const wchar_t *wpath )
p_dir->dd_dir.d_reclen = 0;
p_dir->dd_dir.d_namlen = 2;
wcscpy( p_dir->dd_dir.d_name, L".." );
- p_dir->b_insert_back = VLC_FALSE;
+ p_dir->b_insert_back = false;
return &p_dir->dd_dir;
}
* reduce a fraction
* (adapted from libavcodec, author Michael Niedermayer <michaelni@gmx.at>)
*****************************************************************************/
-vlc_bool_t vlc_ureduce( unsigned *pi_dst_nom, unsigned *pi_dst_den,
+bool vlc_ureduce( unsigned *pi_dst_nom, unsigned *pi_dst_den,
uint64_t i_nom, uint64_t i_den, uint64_t i_max )
{
- vlc_bool_t b_exact = 1;
+ bool b_exact = 1;
uint64_t i_gcd;
if( i_den == 0 )
switch (pid)
{
case -1:
- msg_Err (p_object, "unable to fork (%s)", strerror (errno));
+ msg_Err (p_object, "unable to fork (%m)");
close (fds[0]);
close (fds[1]);
return -1;
case 0:
+ {
+ sigset_t set;
+ sigemptyset (&set);
+ pthread_sigmask (SIG_SETMASK, &set, NULL);
+
/* NOTE:
* Like it or not, close can fail (and not only with EBADF)
*/
&& ((psz_cwd == NULL) || (chdir (psz_cwd) == 0)))
execve (ppsz_argv[0], ppsz_argv, ppsz_env);
- exit (1);
+ exit (EXIT_FAILURE);
+ }
}
close (fds[1]);