Commit 93d8bc14 authored by Benoit Steiner's avatar Benoit Steiner

debut de portage sous solaris

parent b2181174
......@@ -36,7 +36,11 @@
typedef u8 byte_t;
/* Boolean type */
#ifndef SYS_SOLARIS
typedef int boolean_t;
#else
#include <sys/types.h>
#endif
#ifdef SYS_GNU
#define _MACH_I386_BOOLEAN_H_
#endif
......
......@@ -25,6 +25,7 @@
/*****************************************************************************
* Required headers:
* <netinet/in.h>
* <sys/socket.h>
*****************************************************************************/
......
......@@ -128,6 +128,7 @@ intf_thread_t* intf_Create( void )
if( i_best_score == 0 )
{
free( p_intf );
intf_ErrMsg( "error: no suitable plugin to create interface\n" );
return( NULL );
}
......
......@@ -383,7 +383,7 @@ static void QueueMsg( intf_msg_t *p_msg, int i_type, char *psz_format, va_list a
/*
* Convert message to string
*/
#ifdef SYS_BEOS
#if defined SYS_BEOS || defined SYS_SOLARIS
psz_str = (char*) malloc( strlen(psz_format) + INTF_MAX_MSG_SIZE );
vsprintf( psz_str, psz_format, ap );
#else
......@@ -447,7 +447,7 @@ static void QueueDbgMsg(intf_msg_t *p_msg, char *psz_file, char *psz_function,
/*
* Convert message to string
*/
#ifdef SYS_BEOS
#if defined SYS_BEOS || defined SYS_SOLARIS
psz_str = (char*) malloc( INTF_MAX_MSG_SIZE );
vsprintf( psz_str, psz_format, ap );
#else
......
......@@ -28,9 +28,12 @@
#include "defs.h"
#include <signal.h> /* SIGHUP, SIGINT, SIGKILL */
#include <getopt.h> /* getopt() */
#include <stdio.h> /* sprintf() */
#ifdef HAVE_LIBGNUGETOPT
#include <getopt.h> /* getopt() */
#endif
#include <errno.h> /* ENOMEM */
#include <stdlib.h> /* getenv(), strtol(), */
#include <string.h> /* strerror() */
......@@ -91,6 +94,7 @@
#define LONG_HELP 2
/* Long options */
#ifdef HAVE_LIBGNUGETOPT
static const struct option longopts[] =
{
/* name, has_arg, flag, val */
......@@ -137,6 +141,8 @@ static const struct option longopts[] =
/* Short options */
static const char *psz_shortopts = "hHvga:s:c:";
#endif
/*****************************************************************************
* Global variable program_data - this is the one and only, see main.h
......@@ -465,6 +471,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
}
/* Parse command line options */
#ifdef HAVE_LIBGNUGETOPT
opterr = 0;
while( ( c = getopt_long( i_argc, ppsz_argv, psz_shortopts, longopts, 0 ) ) != EOF )
{
......@@ -579,6 +586,7 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
break;
}
}
#endif
/* Parse command line parameters - no check is made for these options */
for( i_opt = optind; i_opt < i_argc; i_opt++ )
......
......@@ -36,10 +36,19 @@
#include <arpa/inet.h> /* inet_ntoa(), inet_aton() */
#endif
#if defined (HAVE_SYS_IOCTL_H) && defined (HAVE_NET_IF_H)
#if defined (HAVE_SYS_IOCTL_H)
#include <sys/ioctl.h> /* ioctl() */
#endif
#include <unistd.h> /* needed for ioctl on Solaris */
#include <stropts.h>
#if defined (HAVE_NET_IF_H)
#include <net/if.h> /* interface (arch-dependent) */
#endif
//#ifdef HAVE_SYS_SOCKIO_H
#include <sys/sockio.h>
//#endif
#include "config.h"
#include "common.h"
......@@ -73,7 +82,7 @@ int BuildInetAddr( struct sockaddr_in *p_sa_in, char *psz_in_addr, int i_port )
}
/* Try to convert address directly from in_addr - this will work if
* psz_in_addr is dotted decimal. */
#ifdef HAVE_ARPA_INET_H
#if defined HAVE_ARPA_INET_H && !defined SYS_SOLARIS
else if( !inet_aton( psz_in_addr, &p_sa_in->sin_addr) )
#else
else if( (p_sa_in->sin_addr.s_addr = inet_addr( psz_in_addr )) == -1 )
......@@ -154,7 +163,11 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
}
/* Read physical address of the interface and store it in our description */
#ifdef SYS_SOLARIS
i_rc = ioctl(i_sockfd, SIOCGENADDR, (byte_t *)&ifr_config);
#else
i_rc = ioctl(i_sockfd, SIOCGIFHWADDR, (byte_t *)&ifr_config);
#endif
if( !i_rc )
{
memcpy(&p_ifdescr->sa_phys_addr, &ifr_config.ifr_addr, sizeof(struct sockaddr));
......@@ -226,6 +239,8 @@ int ReadIfConf(int i_sockfd, if_descr_t* p_ifdescr, char* psz_name)
*****************************************************************************/
int ReadNetConf(int i_sockfd, net_descr_t* p_net_descr)
{
int i_rc = 0;
#if defined (HAVE_SYS_IOCTL_H) && defined (HAVE_NET_IF_H)
struct ifreq* a_ifr_ifconf = NULL;
struct ifreq* p_ifr_current_if;
......@@ -233,10 +248,7 @@ int ReadNetConf(int i_sockfd, net_descr_t* p_net_descr)
int i_if_number;
int i_remaining;
#endif
int i_rc = 0;
#if defined (HAVE_SYS_IOCTL_H) && defined (HAVE_NET_IF_H)
ASSERT(p_net_descr);
/* Start by assuming we have few than 3 interfaces (i_if_number will
......
......@@ -104,7 +104,7 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window,
p_vout = (vout_thread_t *) malloc( sizeof(vout_thread_t) );
if( p_vout == NULL )
{
intf_ErrMsg( "error: %s\n", strerror(ENOMEM) );
intf_ErrMsg( "vout error: %s\n", strerror(ENOMEM) );
return( NULL );
}
......@@ -261,7 +261,7 @@ vout_thread_t * vout_CreateThread ( char *psz_display, int i_root_window,
if( vlc_thread_create( &p_vout->thread_id, "video output",
(void *) RunThread, (void *) p_vout) )
{
intf_ErrMsg("error: %s\n", strerror(ENOMEM));
intf_ErrMsg("vout error: %s\n", strerror(ENOMEM));
vout_UnloadFont( p_vout->p_default_font );
vout_UnloadFont( p_vout->p_large_font );
p_vout->p_sys_destroy( p_vout );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment