Project

General

Profile

Bug #4579 ยป ossl_rand.patch

kosaki (Motohiro KOSAKI), 04/16/2011 12:00 AM

View differences:

ext/openssl/ossl_rand.c (working copy)
171 171
    return RAND_status() ? Qtrue : Qfalse;
172 172
}
173 173

  
174
static void
175
ossl_rand_cleanup(void)
176
{
177
    RAND_cleanup();
178
}
179

  
174 180
#define DEFMETH(class, name, func, argc) \
175 181
	rb_define_method((class), (name), (func), (argc)); \
176 182
	rb_define_singleton_method((class), (name), (func), (argc));
......
197 203
    DEFMETH(mRandom, "pseudo_bytes", ossl_rand_pseudo_bytes, 1);
198 204
    DEFMETH(mRandom, "egd", ossl_rand_egd, 1);
199 205
    DEFMETH(mRandom, "egd_bytes", ossl_rand_egd_bytes, 2);
200
    DEFMETH(mRandom, "status?", ossl_rand_status, 0)
206
    DEFMETH(mRandom, "status?", ossl_rand_status, 0);
207

  
208
    pthread_atfork(NULL, NULL, ossl_rand_cleanup);
201 209
}
202 210