Differential D39779 Diff 121006 www/iridium/files/patch-third__party_sqlite_src_amalgamation_sqlite3.c
Changeset View
Changeset View
Standalone View
Standalone View
www/iridium/files/patch-third__party_sqlite_src_amalgamation_sqlite3.c
--- third_party/sqlite/src/amalgamation/sqlite3.c.orig 2023-04-22 17:45:15 UTC | --- third_party/sqlite/src/amalgamation/sqlite3.c.orig 2023-04-24 20:55:01 UTC | ||||
+++ third_party/sqlite/src/amalgamation/sqlite3.c | +++ third_party/sqlite/src/amalgamation/sqlite3.c | ||||
@@ -43591,7 +43591,12 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nB | @@ -43595,7 +43595,12 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nB | ||||
memset(zBuf, 0, nBuf); | memset(zBuf, 0, nBuf); | ||||
randomnessPid = osGetpid(0); | randomnessPid = osGetpid(0); | ||||
#if !defined(SQLITE_TEST) && !defined(SQLITE_OMIT_RANDOMNESS) | #if !defined(SQLITE_TEST) && !defined(SQLITE_OMIT_RANDOMNESS) | ||||
+#if defined(__OpenBSD__) | +#if defined(__OpenBSD__) | ||||
{ | { | ||||
+ arc4random_buf(zBuf, nBuf); | + arc4random_buf(zBuf, nBuf); | ||||
+ } | + } | ||||
+#else | +#else | ||||
+ { | + { | ||||
int fd, got; | int fd, got; | ||||
fd = robust_open("/dev/urandom", O_RDONLY, 0); | fd = robust_open("/dev/urandom", O_RDONLY, 0); | ||||
if( fd<0 ){ | if( fd<0 ){ | ||||
@@ -43606,6 +43611,7 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nB | @@ -43610,6 +43615,7 @@ static int unixRandomness(sqlite3_vfs *NotUsed, int nB | ||||
robust_close(0, fd, __LINE__); | robust_close(0, fd, __LINE__); | ||||
} | } | ||||
} | } | ||||
+#endif | +#endif | ||||
#endif | #endif | ||||
return nBuf; | return nBuf; | ||||
} | } |