mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 14:42:02 +03:00
Merge pull request #1110 from mrdomino/release-candidate
Fixes the build on OpenBSD
This commit is contained in:
commit
1efb9c3ec4
@ -188,12 +188,7 @@
|
||||
|
||||
/* Entropy
|
||||
*/
|
||||
# if defined(U3_OS_bsd) && defined(__OpenBSD__)
|
||||
# define c3_rand(rd) (getentropy((void*)rd, 64) == 0 ? \
|
||||
(void)0 : c3_assert(!"ent"))
|
||||
# else
|
||||
# define c3_rand u3_sist_rand
|
||||
# endif
|
||||
#define c3_rand u3_sist_rand
|
||||
|
||||
/* Static assertion
|
||||
*/
|
||||
|
@ -282,7 +282,7 @@ elif osdet == 'bsd' or osdet == 'freebsd'
|
||||
|
||||
elif osdet == 'openbsd'
|
||||
conf_data.set('U3_OS_bsd', true)
|
||||
os_link_flags = ['-L /usr/local/lib', '-lgmp', '-lsigsegv', '-lcurses']
|
||||
os_link_flags = ['-L/usr/local/lib', '-lgmp', '-lsigsegv', '-lcurses']
|
||||
gmp_dep = []
|
||||
sigsegv_dep = []
|
||||
|
||||
|
@ -187,7 +187,7 @@ _main_getopt(c3_i argc, c3_c** argv)
|
||||
}
|
||||
|
||||
#if defined(U3_OS_bsd)
|
||||
{
|
||||
if (u3_Host.ops_u.pro == c3y) {
|
||||
fprintf(stderr, "profiling isn't yet supported on BSD\r\n");
|
||||
return c3n;
|
||||
}
|
||||
|
@ -415,12 +415,18 @@ _sist_bask(c3_c* pop_c, u3_noun may)
|
||||
void
|
||||
u3_sist_rand(c3_w* rad_w)
|
||||
{
|
||||
#if defined(U3_OS_bsd) && defined(__OpenBSD__)
|
||||
if (-1 == getentropy(rad_w, 64)) {
|
||||
c3_assert(!"lo_rand");
|
||||
}
|
||||
#else
|
||||
c3_i fid_i = open(DEVRANDOM, O_RDONLY);
|
||||
|
||||
if ( 64 != read(fid_i, (c3_y*) rad_w, 64) ) {
|
||||
c3_assert(!"lo_rand");
|
||||
}
|
||||
close(fid_i);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* _sist_fast(): offer to save passcode by mug in home directory.
|
||||
|
Loading…
Reference in New Issue
Block a user