Skip to content
This repository has been archived by the owner on Apr 15, 2023. It is now read-only.

Commit

Permalink
[mythtv-cmyth] Use correct return types in ADDON_Create.
Browse files Browse the repository at this point in the history
RegisterMe functions must return ADDON_STATUS_PERMANENT_FAILURE on failure.
Return ADDON_STATUS_NEED_SETTINGS if we cannot connect to the backend.
  • Loading branch information
fetzerch committed Oct 11, 2012
1 parent 1ef7017 commit 52e4fe7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions addons/pvr.mythtv.cmyth/src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ extern "C" {
ADDON_STATUS ADDON_Create(void *hdl, void *props)
{
if (!hdl)
return ADDON_STATUS_UNKNOWN;
return ADDON_STATUS_PERMANENT_FAILURE;

// Register handles
XBMC = new CHelper_libXBMC_addon;

if (!XBMC->RegisterMe(hdl))
return ADDON_STATUS_UNKNOWN;
return ADDON_STATUS_PERMANENT_FAILURE;

XBMC->Log(LOG_DEBUG, "Creating MythTV cmyth PVR-Client");

Expand All @@ -86,7 +86,7 @@ ADDON_STATUS ADDON_Create(void *hdl, void *props)
if (!props)
{
SAFE_DELETE(XBMC);
return ADDON_STATUS_UNKNOWN;
return ADDON_STATUS_PERMANENT_FAILURE;
}
XBMC->Log(LOG_DEBUG, "Checking props...done");
PVR_PROPERTIES* pvrprops = (PVR_PROPERTIES*)props;
Expand All @@ -96,7 +96,7 @@ ADDON_STATUS ADDON_Create(void *hdl, void *props)
if (!PVR->RegisterMe(hdl))
{
SAFE_DELETE(XBMC);
return ADDON_STATUS_UNKNOWN;
return ADDON_STATUS_PERMANENT_FAILURE;
}
XBMC->Log(LOG_DEBUG, "Register handle @ libXBMC_addon...done");

Expand All @@ -106,7 +106,7 @@ ADDON_STATUS ADDON_Create(void *hdl, void *props)
{
SAFE_DELETE(PVR);
SAFE_DELETE(XBMC);
return ADDON_STATUS_UNKNOWN;
return ADDON_STATUS_PERMANENT_FAILURE;
}
XBMC->Log(LOG_DEBUG, "Register handle @ libXBMC_gui...done");

Expand Down Expand Up @@ -199,7 +199,7 @@ ADDON_STATUS ADDON_Create(void *hdl, void *props)
SAFE_DELETE(GUI);
SAFE_DELETE(PVR);
SAFE_DELETE(XBMC);
m_CurStatus = ADDON_STATUS_UNKNOWN;
m_CurStatus = ADDON_STATUS_NEED_SETTINGS;
return m_CurStatus;
}
XBMC->Log(LOG_DEBUG,"Creating PVRClientMythTV...done");
Expand Down

0 comments on commit 52e4fe7

Please sign in to comment.