Exemple #1
0
//--------------------------------------------------------------------------------------------------
static void Update
(
    const char* filePathPtr ///< The file path, or "-" for stdin.
)
{
    int fd = GetUpdateFile(filePathPtr);

    le_update_ConnectService();

    // Register for progress notifications.
    le_update_AddProgressHandler(UpdateProgressHandler, NULL);

    // Start update process(asynchronous). Completion will be notified via callback function.
    le_result_t result = le_update_Start(fd);
    switch (result)
    {
        case LE_BUSY:
            fprintf(stderr, "**ERROR: Another update is currently in progress.\n");
            exit(EXIT_FAILURE);

        case LE_UNAVAILABLE:
            fprintf(stderr, "**ERROR: Updates are currently deferred.\n");
            exit(EXIT_FAILURE);

        case LE_OK:
            break;

        default:
            fprintf(stderr, "**ERROR: Unexpected result code from update server.\n");
            exit(EXIT_FAILURE);
    }
}
Exemple #2
0
void* update_CheckReal( vlc_object_t* p_this )
{
    update_check_thread_t *p_uct = (update_check_thread_t *)p_this;
    bool b_ret;
    int canc;

    canc = vlc_savecancel ();
    vlc_mutex_lock( &p_uct->p_update->lock );

    EmptyRelease( p_uct->p_update );
    b_ret = GetUpdateFile( p_uct->p_update );
    vlc_mutex_unlock( &p_uct->p_update->lock );

    if( p_uct->pf_callback )
        (p_uct->pf_callback)( p_uct->p_data, b_ret );

    vlc_restorecancel (canc);
    return NULL;
}