Beispiel #1
0
// Invokes the given application
static int invoke(int prog_argc, char **prog_argv, char *prog_name,
                  char app_type, uint32_t magic_options, bool wait_term, unsigned int respawn_delay,
                  char *splash_file, char *landscape_splash_file, bool test_mode)
{
    int status = 0;
    if (prog_name && prog_argv)
    {
        //If TEST_MODE_CONTROL_FILE doesn't exists switch off test mode
        if (test_mode && access(TEST_MODE_CONTROL_FILE, F_OK) != 0)
        {
            test_mode = false;
            info("Invoker test mode is not enabled.\n");
        }

        // This is a fallback if connection with the launcher
        // process is broken       
        int fd = invoker_init(app_type);
        if (fd == -1)
        {
            invoke_fallback(prog_argv, prog_name, wait_term);
        }
        // "normal" invoke through a socket connetion
        else
        {
            status = invoke_remote(fd, prog_argc, prog_argv, prog_name,
                                   magic_options, wait_term, respawn_delay,
                                   splash_file, landscape_splash_file);
            close(fd);
        }
    }
    
    return status;
}
// Invokes the given application
static int invoke(int prog_argc, char **prog_argv, char *prog_name,
                  enum APP_TYPE app_type, uint32_t magic_options, bool wait_term, unsigned int respawn_delay,
                  char *splash_file, char *landscape_splash_file)
{
    int status = 0;

    if (prog_name && prog_argv)
    {
        // This is a fallback if connection with the launcher
        // process is broken       
        int fd = invoker_init(app_type);
        if (fd == -1)
        {
            invoke_fallback(prog_argv, prog_name, wait_term);
        }
        // "normal" invoke through a socket connetion
        else
        {
            status = invoke_remote(fd, prog_argc, prog_argv, prog_name,
                                   magic_options, wait_term, respawn_delay,
                                   splash_file, landscape_splash_file);
            close(fd);
        }
    }
    
    return status;
}