Skip to content

using non blocking call if possible to generate randomness#963

Closed
devnexen wants to merge 2 commits intoUnvanquished:masterfrom
devnexen:master
Closed

using non blocking call if possible to generate randomness#963
devnexen wants to merge 2 commits intoUnvanquished:masterfrom
devnexen:master

Conversation

@devnexen
Copy link
Copy Markdown
Contributor

@devnexen devnexen commented Oct 9, 2016

No description provided.

size_t bytes_written;
if (nacl_secure_random(dest, size, &bytes_written) != 0 || bytes_written != size)
Sys::Error("nacl_secure_random failed");
#else
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's more readable to have

///...
#elif defined(__linux__) && defined(HAS_GETRANDOM_SYSCALL)
//...
#elif defined(__linux__) 
//...
#endif

@DolceTriade
Copy link
Copy Markdown
Member

Seems like the error here is somewhere else? This looks ok to me.

@mjstahlberg
Copy link
Copy Markdown
Member

@DolceTriade what error are you talking about? Also, OK to merge now (also @mbasaglia)?

@mbasaglia
Copy link
Copy Markdown
Member

mbasaglia commented Jan 2, 2017

TBH I'd just use <random> instead of all this custom code, but the changes themselves look ok to me.

@illwieckz
Copy link
Copy Markdown
Member

Hi @devnexen! The Dæmon Engine is now extracted from this source tree, you can find its dedicated repository there:

Can you replay your pull request on this repository? Merci et bienvenue ! 😉

@devnexen
Copy link
Copy Markdown
Contributor Author

Sure :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants