/** Do the cron action and wait for result exit value */ static void* win_do_cron(void* ATTR_UNUSED(arg)) { int mynum=65; char* cronaction; log_thread_set(&mynum); cronaction = lookup_reg_str("Software\\Unbound", "CronAction"); if(cronaction && strlen(cronaction)>0) { STARTUPINFO sinfo; PROCESS_INFORMATION pinfo; memset(&pinfo, 0, sizeof(pinfo)); memset(&sinfo, 0, sizeof(sinfo)); sinfo.cb = sizeof(sinfo); verbose(VERB_ALGO, "cronaction: %s", cronaction); if(!CreateProcess(NULL, cronaction, NULL, NULL, 0, CREATE_NO_WINDOW, NULL, NULL, &sinfo, &pinfo)) log_err("CreateProcess error"); else { waitforit(&pinfo); CloseHandle(pinfo.hProcess); CloseHandle(pinfo.hThread); } } free(cronaction); /* stop self */ CloseHandle(cron_thread); cron_thread = NULL; return NULL; }
static int do_write(SSL *ssl, const void *buf, int len) { int ret; again: ret = SSL_write(ssl, buf, len); if (ret < 0) { if (waitforit(ssl)) { goto again; } else { return -1; } } return ret; }
static int do_accept(SSL *ssl) { int ret; again: ret = SSL_accept(ssl); if (ret < 0) { if (waitforit(ssl)) { goto again; } else { return -1; } } return ret; }
/* =============== R_Init =============== */ void R_Init( void ) { int err; int i; byte *ptr; waitforit("R_Init 1"); ri.Printf( PRINT_ALL, "----- R_Init -----\n" ); // clear all our internal state Com_Memset( &tr, 0, sizeof( tr ) ); Com_Memset( &backEnd, 0, sizeof( backEnd ) ); Com_Memset( &tess, 0, sizeof( tess ) ); // Swap_Init(); waitforit("R_Init 2"); if ((int)tess.xyz & 15) { Com_Printf( "WARNING: tess.xyz not 16 byte aligned\n" ); } Com_Memset( tess.constantColor255, 255, sizeof( tess.constantColor255 ) ); // // init function tables // waitforit("R_Init 3"); for (i = 0; i < FUNCTABLE_SIZE; i++) { tr.sinTable[i] = sin( DEG2RAD( i * 360.0f / ( ( float ) ( FUNCTABLE_SIZE - 1 ) ) ) ); tr.squareTable[i] = ( i < FUNCTABLE_SIZE/2 ) ? 1.0f : -1.0f; tr.sawToothTable[i] = (float)i / FUNCTABLE_SIZE; tr.inverseSawToothTable[i] = 1.0f - tr.sawToothTable[i]; if ( i < FUNCTABLE_SIZE / 2 ) { if ( i < FUNCTABLE_SIZE / 4 ) { tr.triangleTable[i] = ( float ) i / ( FUNCTABLE_SIZE / 4 ); } else { tr.triangleTable[i] = 1.0f - tr.triangleTable[i-FUNCTABLE_SIZE / 4]; } } else { tr.triangleTable[i] = -tr.triangleTable[i-FUNCTABLE_SIZE/2]; } } waitforit("R_Init 4"); R_InitFogTable(); waitforit("R_Init 5"); R_NoiseInit(); waitforit("R_Init 6"); R_Register(); max_polys = r_maxpolys->integer; if (max_polys < MAX_POLYS) max_polys = MAX_POLYS; waitforit("R_Init 7"); max_polyverts = r_maxpolyverts->integer; if (max_polyverts < MAX_POLYVERTS) max_polyverts = MAX_POLYVERTS; waitforit("R_Init 8"); ptr = ri.Hunk_Alloc(sizeof(*backEndData[0]), h_low); backEndData[0] = (backEndData_t *) ptr; if ( r_smp->integer ) { ptr = ri.Hunk_Alloc( sizeof( *backEndData[1] ), h_low); backEndData[1] = (backEndData_t *) ptr; } else { backEndData[1] = NULL; } waitforit("R_Init 9"); R_ToggleSmpFrame(); waitforit("R_Init A"); InitOpenGL(); waitforit("R_Init B"); R_InitImages(); waitforit("R_Init C"); R_InitShaders(); waitforit("R_Init D"); R_InitSkins(); waitforit("R_Init E"); R_ModelInit(); waitforit("R_Init F"); R_InitFreeType(); waitforit("R_Init G"); err = qglGetError(); if ( err != GL_NO_ERROR ) ri.Printf (PRINT_ALL, "glGetError() = 0x%x\n", err); waitforit("R_Init H"); ri.Printf(PRINT_ALL, "----- finished R_Init -----\n"); waitforit("R_Init I"); }