SF Patch Tracker [ 2854711 ] Patch for Solaris10 compilation and usage

Submitted By: zephyrus ( zephyrus00jp )

Patch for Solaris10 compilation and usage.
(cherry picked from commit 5755ac022f)
This commit is contained in:
Marcelo Roberto Jimenez
2010-09-10 19:02:31 -03:00
parent 30ee3c0cbb
commit 6604d0a974
5 changed files with 27 additions and 16 deletions

View File

@@ -2,6 +2,12 @@
Version 1.8.0 Version 1.8.0
******************************************************************************* *******************************************************************************
2010-09-10 Chandra Penke <chandrapenke(at)mcntech.com>
* SF Patch Tracker [ 2854711 ] Patch for Solaris10 compilation and usage
Submitted By: zephyrus ( zephyrus00jp )
Patch for Solaris10 compilation and usage.
2010-09-10 Chandra Penke <chandrapenke(at)mcntech.com> 2010-09-10 Chandra Penke <chandrapenke(at)mcntech.com>
Add support for conditionally enabling ipv6. Add support for conditionally enabling ipv6.

View File

@@ -43,7 +43,8 @@
#endif #endif
int initialize = 1; static int initialize_init = 1;
static int initialize_register = 1;
/*! Function pointers to use for displaying formatted strings. /*! Function pointers to use for displaying formatted strings.
* Set on Initialization of device. */ * Set on Initialization of device. */
@@ -67,7 +68,7 @@ ithread_mutex_t display_mutex;
******************************************************************************/ ******************************************************************************/
int SampleUtil_Initialize(print_string print_function) int SampleUtil_Initialize(print_string print_function)
{ {
if (initialize) { if (initialize_init) {
ithread_mutexattr_t attr; ithread_mutexattr_t attr;
ithread_mutexattr_init(&attr); ithread_mutexattr_init(&attr);
@@ -80,7 +81,7 @@ int SampleUtil_Initialize(print_string print_function)
gPrintFun = print_function; gPrintFun = print_function;
ithread_mutex_unlock(&display_mutex); ithread_mutex_unlock(&display_mutex);
initialize = 0; initialize_init = 0;
} else { } else {
SampleUtil_Print("***** SampleUtil_Initialize was called multiple times!\n"); SampleUtil_Print("***** SampleUtil_Initialize was called multiple times!\n");
abort(); abort();
@@ -99,12 +100,9 @@ int SampleUtil_Initialize(print_string print_function)
******************************************************************************/ ******************************************************************************/
int SampleUtil_RegisterUpdateFunction(state_update update_function) int SampleUtil_RegisterUpdateFunction(state_update update_function)
{ {
/* Intialize only once. */ if (initialize_register) {
static int initialize = 1;
if (initialize) {
gStateUpdateFun = update_function; gStateUpdateFun = update_function;
initialize = 0; initialize_register = 0;
} }
return UPNP_E_SUCCESS; return UPNP_E_SUCCESS;
@@ -123,7 +121,9 @@ int SampleUtil_Finish()
{ {
ithread_mutex_destroy(&display_mutex); ithread_mutex_destroy(&display_mutex);
gPrintFun = NULL; gPrintFun = NULL;
initialize = 1; gStateUpdateFun = NULL;
initialize_init = 1;
initialize_register = 1;
return UPNP_E_SUCCESS; return UPNP_E_SUCCESS;
} }

View File

@@ -1317,7 +1317,8 @@ int TvCtrlPointStart(print_string printFunctionPtr, state_update updateFunctionP
SampleUtil_Print( SampleUtil_Print(
"Initializing UPnP Sdk with\n" "Initializing UPnP Sdk with\n"
"\tipaddress = %s port = %u\n", "\tipaddress = %s port = %u\n",
ip_address, port); ip_address ? ip_address : "{NULL}",
port);
rc = UpnpInit(ip_address, port); rc = UpnpInit(ip_address, port);
if (rc != UPNP_E_SUCCESS) { if (rc != UPNP_E_SUCCESS) {

View File

@@ -1856,7 +1856,8 @@ TvDeviceStart( char *ip_address,
SampleUtil_Print( SampleUtil_Print(
"Initializing UPnP Sdk with\n" "Initializing UPnP Sdk with\n"
"\tipaddress = %s port = %u\n", "\tipaddress = %s port = %u\n",
ip_address, port ); ip_address ? ip_address : "{NULL}",
port);
ret = UpnpInit( ip_address, port ); ret = UpnpInit( ip_address, port );
if( ret != UPNP_E_SUCCESS ) { if( ret != UPNP_E_SUCCESS ) {
@@ -1870,8 +1871,9 @@ TvDeviceStart( char *ip_address,
SampleUtil_Print( SampleUtil_Print(
"UPnP Initialized\n" "UPnP Initialized\n"
"\tipaddress= %s port = %u\n", "\tipaddress = %s port = %u\n",
ip_address, port ); ip_address ? ip_address : "{NULL}",
port);
if( desc_doc_name == NULL ) { if( desc_doc_name == NULL ) {
desc_doc_name = "tvcombodesc.xml"; desc_doc_name = "tvcombodesc.xml";

View File

@@ -1341,7 +1341,8 @@ int TvCtrlPointStart(print_string printFunctionPtr, state_update updateFunctionP
SampleUtil_Print( SampleUtil_Print(
"Initializing UPnP Sdk with\n" "Initializing UPnP Sdk with\n"
"\tipaddress = %s port = %u\n", "\tipaddress = %s port = %u\n",
ip_address, port); ip_address ? ip_address : "{NULL}",
port);
rc = UpnpInit(ip_address, port); rc = UpnpInit(ip_address, port);
if (rc != UPNP_E_SUCCESS) { if (rc != UPNP_E_SUCCESS) {
@@ -1358,8 +1359,9 @@ int TvCtrlPointStart(print_string printFunctionPtr, state_update updateFunctionP
SampleUtil_Print( SampleUtil_Print(
"UPnP Initialized\n" "UPnP Initialized\n"
"\tipaddress= %s port = %u\n", "\tipaddress = %s port = %u\n",
ip_address, port); ip_address ? ip_address : "{NULL}",
port);
SampleUtil_Print("Registering Control Point"); SampleUtil_Print("Registering Control Point");
rc = UpnpRegisterClient(TvCtrlPointCallbackEventHandler, rc = UpnpRegisterClient(TvCtrlPointCallbackEventHandler,