diff --git a/package/sg3_utils/patches/0001-remove-HAVE_GETRANDOM.patch-coolstream b/package/sg3_utils/patches/0001-remove-HAVE_GETRANDOM.patch-coolstream new file mode 100644 index 00000000..f06ea2db --- /dev/null +++ b/package/sg3_utils/patches/0001-remove-HAVE_GETRANDOM.patch-coolstream @@ -0,0 +1,33 @@ +diff --git a/src/sg_dd.c b/src/sg_dd.c +index 9d05c93..aa9323b 100644 +--- a/src/sg_dd.c ++++ b/src/sg_dd.c +@@ -60,9 +60,6 @@ + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif +-#ifdef HAVE_GETRANDOM +-#include /* for getrandom() system call */ +-#endif + #include "sg_lib.h" + #include "sg_cmds_basic.h" + #include "sg_cmds_extra.h" +@@ -2114,18 +2111,7 @@ main(int argc, char * argv[]) + } else if (iflag.random) { + ccp = ""; + cc2p = "random"; +-#ifdef HAVE_GETRANDOM +- { +- ssize_t ssz = getrandom(&seed, sizeof(seed), GRND_NONBLOCK); +- +- if (ssz < (ssize_t)sizeof(seed)) { +- pr2serr("getrandom() failed, ret=%d\n", (int)ssz); +- seed = (long)time(NULL); +- } +- } +-#else + seed = (long)time(NULL); /* use seconds since epoch as proxy */ +-#endif + if (verbose > 1) + pr2serr("seed=%ld\n", seed); + #ifdef HAVE_SRAND48_R