ruby-changes:52471
From: nobu <ko1@a...>
Date: Tue, 11 Sep 2018 20:05:24 +0900 (JST)
Subject: [ruby-changes:52471] nobu:r64680 (trunk): random.c: prefixed fill_random_bytes
nobu 2018-09-11 20:05:20 +0900 (Tue, 11 Sep 2018) New Revision: 64680 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64680 Log: random.c: prefixed fill_random_bytes Modified files: trunk/internal.h trunk/random.c trunk/vm_insnhelper.c Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 64679) +++ vm_insnhelper.c (revision 64680) @@ -3913,7 +3913,7 @@ void https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L3913 Init_vm_stack_canary(void) { /* This has to be called _after_ our PRNG is properly set up. */ - int n = fill_random_bytes(&vm_stack_canary, sizeof vm_stack_canary, false); + int n = ruby_fill_random_bytes(&vm_stack_canary, sizeof vm_stack_canary, false); VM_ASSERT(n == 0); } Index: internal.h =================================================================== --- internal.h (revision 64679) +++ internal.h (revision 64680) @@ -2104,7 +2104,7 @@ VALUE rb_imemo_new(enum imemo_type type, https://github.com/ruby/ruby/blob/trunk/internal.h#L2104 #endif /* random.c */ -int fill_random_bytes(void *, size_t, int); +int ruby_fill_random_bytes(void *, size_t, int); RUBY_SYMBOL_EXPORT_END Index: random.c =================================================================== --- random.c (revision 64679) +++ random.c (revision 64680) @@ -574,13 +574,15 @@ fill_random_bytes_syscall(void *seed, si https://github.com/ruby/ruby/blob/trunk/random.c#L574 #endif int -fill_random_bytes(void *seed, size_t size, int need_secure) +ruby_fill_random_bytes(void *seed, size_t size, int need_secure) { int ret = fill_random_bytes_syscall(seed, size, need_secure); if (ret == 0) return ret; return fill_random_bytes_urandom(seed, size); } +#define fill_random_bytes ruby_fill_random_bytes + static void fill_random_seed(uint32_t *seed, size_t cnt) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/