diff options
| -rw-r--r-- | meta-oe/recipes-extended/sanlock/sanlock/0001-fix-compile-failure-with-libc-musl.patch | 80 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/sanlock/sanlock_3.8.0.bb (renamed from meta-oe/recipes-extended/sanlock/sanlock_3.6.0.bb) | 6 |
2 files changed, 2 insertions, 84 deletions
diff --git a/meta-oe/recipes-extended/sanlock/sanlock/0001-fix-compile-failure-with-libc-musl.patch b/meta-oe/recipes-extended/sanlock/sanlock/0001-fix-compile-failure-with-libc-musl.patch deleted file mode 100644 index e4bde80a0b..0000000000 --- a/meta-oe/recipes-extended/sanlock/sanlock/0001-fix-compile-failure-with-libc-musl.patch +++ /dev/null | |||
| @@ -1,80 +0,0 @@ | |||
| 1 | From c51c2c543f3c78b2a68acc61f786f903f2e0fec8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 3 | Date: Sun, 9 Sep 2018 07:28:09 -0400 | ||
| 4 | Subject: [PATCH] fix compile failure with libc musl | ||
| 5 | |||
| 6 | The lack of random_r in musl: | ||
| 7 | [snip] | ||
| 8 | |main.c:1393:7: warning: implicit declaration of function 'random_r'; | ||
| 9 | did you mean 'random'? [-Wimplicit-function-declaration] | ||
| 10 | | rv = random_r(&rand_data, &val); | ||
| 11 | | ^~~~~~~~ | ||
| 12 | | random | ||
| 13 | |main.c:1408:30: error: invalid application of 'sizeof' to incomplete | ||
| 14 | type 'struct random_data' | ||
| 15 | | memset(&rand_data, 0, sizeof(rand_data)); | ||
| 16 | [snip] | ||
| 17 | |||
| 18 | s/random_r/random/, s/initstate_r/initstate/ and remove `static struct | ||
| 19 | random_data rand_data' | ||
| 20 | |||
| 21 | Here is the man of `random_r()': | ||
| 22 | [snip] | ||
| 23 | The random_r() function is like random(3), except that instead of using | ||
| 24 | state information maintained in a global variable | ||
| 25 | [snip] | ||
| 26 | |||
| 27 | So use random without state information is OK. | ||
| 28 | |||
| 29 | Upstream-Status: Submitted [sanlock-devel@lists.fedorahosted.org] | ||
| 30 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> | ||
| 31 | --- | ||
| 32 | src/main.c | 12 ++++-------- | ||
| 33 | 1 file changed, 4 insertions(+), 8 deletions(-) | ||
| 34 | |||
| 35 | diff --git a/src/main.c b/src/main.c | ||
| 36 | index f60b4d3..602c400 100644 | ||
| 37 | --- a/src/main.c | ||
| 38 | +++ b/src/main.c | ||
| 39 | @@ -84,7 +84,6 @@ static char command[COMMAND_MAX]; | ||
| 40 | static int cmd_argc; | ||
| 41 | static char **cmd_argv; | ||
| 42 | static struct thread_pool pool; | ||
| 43 | -static struct random_data rand_data; | ||
| 44 | static char rand_state[32]; | ||
| 45 | static pthread_mutex_t rand_mutex = PTHREAD_MUTEX_INITIALIZER; | ||
| 46 | static const char *run_dir = NULL; | ||
| 47 | @@ -1386,16 +1385,15 @@ int get_rand(int a, int b); | ||
| 48 | |||
| 49 | int get_rand(int a, int b) | ||
| 50 | { | ||
| 51 | - int32_t val; | ||
| 52 | - int rv; | ||
| 53 | + long int rv; | ||
| 54 | |||
| 55 | pthread_mutex_lock(&rand_mutex); | ||
| 56 | - rv = random_r(&rand_data, &val); | ||
| 57 | + rv = random(); | ||
| 58 | pthread_mutex_unlock(&rand_mutex); | ||
| 59 | if (rv < 0) | ||
| 60 | return rv; | ||
| 61 | |||
| 62 | - return a + (int) (((float)(b - a + 1)) * val / (RAND_MAX+1.0)); | ||
| 63 | + return a + (int) (((float)(b - a + 1)) * rv / (RAND_MAX+1.0)); | ||
| 64 | } | ||
| 65 | |||
| 66 | static void setup_host_name(void) | ||
| 67 | @@ -1405,9 +1403,7 @@ static void setup_host_name(void) | ||
| 68 | uuid_t uu; | ||
| 69 | |||
| 70 | memset(rand_state, 0, sizeof(rand_state)); | ||
| 71 | - memset(&rand_data, 0, sizeof(rand_data)); | ||
| 72 | - | ||
| 73 | - initstate_r(time(NULL), rand_state, sizeof(rand_state), &rand_data); | ||
| 74 | + initstate(time(NULL), rand_state, sizeof(rand_state)); | ||
| 75 | |||
| 76 | /* use host name from command line */ | ||
| 77 | |||
| 78 | -- | ||
| 79 | 2.8.1 | ||
| 80 | |||
diff --git a/meta-oe/recipes-extended/sanlock/sanlock_3.6.0.bb b/meta-oe/recipes-extended/sanlock/sanlock_3.8.0.bb index c51bccce3b..9f7ce9c570 100644 --- a/meta-oe/recipes-extended/sanlock/sanlock_3.6.0.bb +++ b/meta-oe/recipes-extended/sanlock/sanlock_3.8.0.bb | |||
| @@ -11,10 +11,8 @@ SECTION = "utils" | |||
| 11 | LICENSE = "LGPLv2+ & GPLv2 & GPLv2+" | 11 | LICENSE = "LGPLv2+ & GPLv2 & GPLv2+" |
| 12 | LIC_FILES_CHKSUM = "file://README.license;md5=60487bf0bf429d6b5aa72b6d37a0eb22" | 12 | LIC_FILES_CHKSUM = "file://README.license;md5=60487bf0bf429d6b5aa72b6d37a0eb22" |
| 13 | 13 | ||
| 14 | SRC_URI = "git://pagure.io/sanlock.git;protocol=http \ | 14 | SRC_URI = "git://pagure.io/sanlock.git;protocol=http" |
| 15 | file://0001-fix-compile-failure-with-libc-musl.patch \ | 15 | SRCREV = "7afe0e66f5c7f24894896fad20ffa6f39733d80f" |
| 16 | " | ||
| 17 | SRCREV = "90b2ffa77edd46bea007b7bb39bfd4d2db2ff7af" | ||
| 18 | S = "${WORKDIR}/git" | 16 | S = "${WORKDIR}/git" |
| 19 | 17 | ||
| 20 | DEPENDS = "libaio util-linux" | 18 | DEPENDS = "libaio util-linux" |
