static int __init init_ima(void) { int error; error = ima_init(); ima_initialized = 1; return error; }
static int __init init_ima(void) { int error; hash_setup(CONFIG_IMA_DEFAULT_HASH); error = ima_init(); if (!error) ima_initialized = 1; return error; }
static void play() { ALCdevice *dev; ALCcontext *ctx; unsigned src; unsigned bufs[2]; unsigned buf; int v; float zero[3]; memset(zero, 0, sizeof zero); dev = alcOpenDevice(NULL); ctx = alcCreateContext(dev, NULL); alcMakeContextCurrent(ctx); alGenSources(1, &src); alGenBuffers(2, bufs); alSourcef(src, AL_PITCH, 1.0f); alSourcef(src, AL_GAIN, 1.0f); alSourcefv(src, AL_POSITION, zero); alSourcefv(src, AL_VELOCITY, zero); alSourcei(src, AL_SOURCE_RELATIVE, AL_TRUE); alSourcei(src, AL_LOOPING, AL_FALSE); ima_init(&ima_state); queue(src, bufs[0]); queue(src, bufs[1]); alSourcePlay(src); for (;;) { alGetSourcei(src, AL_BUFFERS_PROCESSED, &v); while (v-- > 0) { alSourceUnqueueBuffers(src, 1, &buf); queue(src, buf); } alGetSourcei(src, AL_SOURCE_STATE, &v); if (v == AL_STOPPED) break; usleep(1000); } alDeleteSources(1, &src); alDeleteBuffers(2, bufs); alcMakeContextCurrent(NULL); alcDestroyContext(ctx); alcCloseDevice(dev); }
static int __init init_ima(void) { int error; hash_setup(CONFIG_IMA_DEFAULT_HASH); error = ima_init(); if (!error) { ima_initialized = 1; ima_update_policy_flag(); } return error; }
static int __init init_ima(void) { int error; ima_init_template_list(); hash_setup(CONFIG_IMA_DEFAULT_HASH); error = ima_init(); if (error && strcmp(hash_algo_name[ima_hash_algo], CONFIG_IMA_DEFAULT_HASH) != 0) { pr_info("Allocating %s failed, going to use default hash algorithm %s\n", hash_algo_name[ima_hash_algo], CONFIG_IMA_DEFAULT_HASH); hash_setup_done = 0; hash_setup(CONFIG_IMA_DEFAULT_HASH); error = ima_init(); } if (!error) ima_update_policy_flag(); return error; }
static int __init init_ima(void) { int error; hash_setup(CONFIG_IMA_DEFAULT_HASH); error = ima_init(); if (error) goto out; error = ima_init_keyring(INTEGRITY_KEYRING_IMA); if (error) goto out; ima_initialized = 1; out: return error; }