From 27c8f5913dd0f0f996598bde1780ede8ae96f66b Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Sat, 14 Jan 2017 13:47:49 -0500 Subject: [PATCH] Fix static overriding global in crypto/random/seed/GetEntropyRandomSeed.c --- cjdns.errors.patch | 30 ++++++++++++++++++++++++++++++ cjdns.spec | 3 +++ 2 files changed, 33 insertions(+) create mode 100644 cjdns.errors.patch diff --git a/cjdns.errors.patch b/cjdns.errors.patch new file mode 100644 index 0000000..0ae12c3 --- /dev/null +++ b/cjdns.errors.patch @@ -0,0 +1,30 @@ +diff -up ./crypto/random/seed/GetEntropyRandomSeed.c.errors ./crypto/random/seed/GetEntropyRandomSeed.c +--- ./crypto/random/seed/GetEntropyRandomSeed.c.errors 2017-01-14 13:42:22.043640582 -0500 ++++ ./crypto/random/seed/GetEntropyRandomSeed.c 2017-01-14 13:43:01.482108873 -0500 +@@ -22,7 +22,8 @@ + #include + + #ifndef __OPENBSD__ +-static int getentropy(void *buf, size_t buflen) ++/* NOTE: getentropy() is already defined in unistd.h */ ++static int get_entropy(void *buf, size_t buflen) + { + int ret; + +@@ -48,7 +49,7 @@ static int getentropy(void *buf, size_t + + static int get(struct RandomSeed* randomSeed, uint64_t output[8]) + { +- if (getentropy(output, 64) < 0) { ++ if (get_entropy(output, 64) < 0) { + return -1; + } else { + return 0; +@@ -59,6 +60,6 @@ struct RandomSeed* GetEntropyRandomSeed_ + { + return Allocator_clone(alloc, (&(struct RandomSeed) { + .get = get, +- .name = "getentropy(2)" ++ .name = "get_entropy(2)" + })); + } diff --git a/cjdns.spec b/cjdns.spec index 295a7aa..3a2482d 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -92,6 +92,8 @@ Patch11: cjdns.sodium.patch Patch12: cjdns.sign.patch # Recognize ppc64, ppc64le, and s390x arches Patch13: cjdns.ppc64.patch +# Fix C coding errors +Patch14: cjdns.errors.patch BuildRequires: nodejs, nodejs-ronn, python2 @@ -206,6 +208,7 @@ fi %patch9 -b .man %patch10 -b .tools %patch13 -b .ppc64 +%patch14 -b .errors cp %{SOURCE1} README_Fedora.md