diff options
author | Khem Raj <raj.khem@gmail.com> | 2021-06-04 12:07:22 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2021-06-05 06:06:27 -0700 |
commit | 4bcefa8176cb832a20f17c548a3108e7e57d6cf0 (patch) | |
tree | b36e76d296ee41d9ef3dfbe04762a676f099d165 /meta-networking | |
parent | eada1065ae51a0f47dcbe50714972cf6c6efa8ad (diff) | |
download | meta-openembedded-4bcefa8176cb832a20f17c548a3108e7e57d6cf0.tar.gz |
memcached: upgrade to 1.6.9
Fix Set but unused clang warning
sigignore issue is already fixed in 1.6.9
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking')
-rw-r--r-- | meta-networking/recipes-support/memcached/memcached/0001-Replace-sigignore-with-signal-API.patch | 74 | ||||
-rw-r--r-- | meta-networking/recipes-support/memcached/memcached/0002-stats_prefix.c-Check-for-NDEBUG-before-using-total_w.patch | 48 | ||||
-rw-r--r-- | meta-networking/recipes-support/memcached/memcached_1.6.9.bb (renamed from meta-networking/recipes-support/memcached/memcached_1.6.6.bb) | 4 |
3 files changed, 50 insertions, 76 deletions
diff --git a/meta-networking/recipes-support/memcached/memcached/0001-Replace-sigignore-with-signal-API.patch b/meta-networking/recipes-support/memcached/memcached/0001-Replace-sigignore-with-signal-API.patch deleted file mode 100644 index e4aa8fda3..000000000 --- a/meta-networking/recipes-support/memcached/memcached/0001-Replace-sigignore-with-signal-API.patch +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | From b9040acdba1245f8cdf5e94384830e3d04fde98a Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 22 Jul 2020 21:32:14 -0700 | ||
4 | Subject: [PATCH] Replace sigignore with signal API | ||
5 | |||
6 | sigignore has been deprecated in glibc 2.32+ [1] and eventually it will be | ||
7 | removed, therefore substitute it | ||
8 | |||
9 | [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=02802fafcf6e11ea3f998f685035ffe568dfddeb | ||
10 | |||
11 | Upstream-Status: Submitted [https://github.com/memcached/memcached/pull/702] | ||
12 | |||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | configure.ac | 1 - | ||
16 | memcached.c | 16 ++-------------- | ||
17 | 2 files changed, 2 insertions(+), 15 deletions(-) | ||
18 | |||
19 | diff --git a/configure.ac b/configure.ac | ||
20 | index ffc98b2..4567b30 100644 | ||
21 | --- a/configure.ac | ||
22 | +++ b/configure.ac | ||
23 | @@ -630,7 +630,6 @@ AC_CHECK_FUNCS(mlockall) | ||
24 | AC_CHECK_FUNCS(getpagesizes) | ||
25 | AC_CHECK_FUNCS(sysconf) | ||
26 | AC_CHECK_FUNCS(memcntl) | ||
27 | -AC_CHECK_FUNCS(sigignore) | ||
28 | AC_CHECK_FUNCS(clock_gettime) | ||
29 | AC_CHECK_FUNCS(preadv) | ||
30 | AC_CHECK_FUNCS(pread) | ||
31 | diff --git a/memcached.c b/memcached.c | ||
32 | index 9cb778d..91ced9e 100644 | ||
33 | --- a/memcached.c | ||
34 | +++ b/memcached.c | ||
35 | @@ -8292,18 +8292,6 @@ static void sig_usrhandler(const int sig) { | ||
36 | stop_main_loop = GRACE_STOP; | ||
37 | } | ||
38 | |||
39 | -#ifndef HAVE_SIGIGNORE | ||
40 | -static int sigignore(int sig) { | ||
41 | - struct sigaction sa = { .sa_handler = SIG_IGN, .sa_flags = 0 }; | ||
42 | - | ||
43 | - if (sigemptyset(&sa.sa_mask) == -1 || sigaction(sig, &sa, 0) == -1) { | ||
44 | - return -1; | ||
45 | - } | ||
46 | - return 0; | ||
47 | -} | ||
48 | -#endif | ||
49 | - | ||
50 | - | ||
51 | /* | ||
52 | * On systems that supports multiple page sizes we may reduce the | ||
53 | * number of TLB-misses by using the biggest available page size | ||
54 | @@ -9996,7 +9984,7 @@ int main (int argc, char **argv) { | ||
55 | /* daemonize if requested */ | ||
56 | /* if we want to ensure our ability to dump core, don't chdir to / */ | ||
57 | if (do_daemonize) { | ||
58 | - if (sigignore(SIGHUP) == -1) { | ||
59 | + if (signal(SIGHUP, SIG_IGN) == SIG_ERR) { | ||
60 | perror("Failed to ignore SIGHUP"); | ||
61 | } | ||
62 | if (daemonize(maxcore, settings.verbose) == -1) { | ||
63 | @@ -10146,7 +10134,7 @@ int main (int argc, char **argv) { | ||
64 | * ignore SIGPIPE signals; we can use errno == EPIPE if we | ||
65 | * need that information | ||
66 | */ | ||
67 | - if (sigignore(SIGPIPE) == -1) { | ||
68 | + if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { | ||
69 | perror("failed to ignore SIGPIPE; sigaction"); | ||
70 | exit(EX_OSERR); | ||
71 | } | ||
72 | -- | ||
73 | 2.27.0 | ||
74 | |||
diff --git a/meta-networking/recipes-support/memcached/memcached/0002-stats_prefix.c-Check-for-NDEBUG-before-using-total_w.patch b/meta-networking/recipes-support/memcached/memcached/0002-stats_prefix.c-Check-for-NDEBUG-before-using-total_w.patch new file mode 100644 index 000000000..2979552a3 --- /dev/null +++ b/meta-networking/recipes-support/memcached/memcached/0002-stats_prefix.c-Check-for-NDEBUG-before-using-total_w.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From d6294e9166e4875a0572349aabcc5e51acbd2e3c Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 4 Jun 2021 11:33:12 -0700 | ||
4 | Subject: [PATCH] stats_prefix.c: Check for NDEBUG before using total_written | ||
5 | variable | ||
6 | |||
7 | When using NDEBUG assert macro is ineffective which is caught by latest | ||
8 | clang and reports that total_written is set but unused. Therefore check | ||
9 | for NDEBUG to make sure assert is used only when its effective | ||
10 | |||
11 | Fixes | ||
12 | error: variable 'total_written' set but not used [-Werror,-Wunused-but-set-variable] | ||
13 | size_t size = 0, written = 0, total_written = 0; | ||
14 | ^ | ||
15 | Upstream-Status: Submitted [https://github.com/memcached/memcached/pull/792] | ||
16 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
17 | --- | ||
18 | stats_prefix.c | 8 ++++++-- | ||
19 | 1 file changed, 6 insertions(+), 2 deletions(-) | ||
20 | |||
21 | diff --git a/stats_prefix.c b/stats_prefix.c | ||
22 | index 62f0d04..d72e514 100644 | ||
23 | --- a/stats_prefix.c | ||
24 | +++ b/stats_prefix.c | ||
25 | @@ -127,8 +127,10 @@ char *stats_prefix_dump(int *length) { | ||
26 | PREFIX_STATS *pfs; | ||
27 | char *buf; | ||
28 | int i, pos; | ||
29 | - size_t size = 0, written = 0, total_written = 0; | ||
30 | - | ||
31 | + size_t size = 0, written = 0; | ||
32 | +#ifndef NDEBUG | ||
33 | + size_t total_written = 0; | ||
34 | +#endif | ||
35 | /* | ||
36 | * Figure out how big the buffer needs to be. This is the sum of the | ||
37 | * lengths of the prefixes themselves, plus the size of one copy of | ||
38 | @@ -154,8 +156,10 @@ char *stats_prefix_dump(int *length) { | ||
39 | pfs->prefix, pfs->num_gets, pfs->num_hits, | ||
40 | pfs->num_sets, pfs->num_deletes); | ||
41 | pos += written; | ||
42 | +#ifndef NDEBUG | ||
43 | total_written += written; | ||
44 | assert(total_written < size); | ||
45 | +#endif | ||
46 | } | ||
47 | } | ||
48 | |||
diff --git a/meta-networking/recipes-support/memcached/memcached_1.6.6.bb b/meta-networking/recipes-support/memcached/memcached_1.6.9.bb index 2eb24db9a..73e18a403 100644 --- a/meta-networking/recipes-support/memcached/memcached_1.6.6.bb +++ b/meta-networking/recipes-support/memcached/memcached_1.6.9.bb | |||
@@ -21,9 +21,9 @@ RDEPENDS_${PN} += "perl perl-module-posix perl-module-autoloader \ | |||
21 | 21 | ||
22 | SRC_URI = "http://www.memcached.org/files/${BP}.tar.gz \ | 22 | SRC_URI = "http://www.memcached.org/files/${BP}.tar.gz \ |
23 | file://memcached-add-hugetlbfs-check.patch \ | 23 | file://memcached-add-hugetlbfs-check.patch \ |
24 | file://0001-Replace-sigignore-with-signal-API.patch \ | 24 | file://0002-stats_prefix.c-Check-for-NDEBUG-before-using-total_w.patch \ |
25 | " | 25 | " |
26 | SRC_URI[sha256sum] = "908f0eecfa559129c9e44edc46f02e73afe8faca355b4efc5c86d902fc3e32f7" | 26 | SRC_URI[sha256sum] = "d5a62ce377314dbffdb37c4467e7763e3abae376a16171e613cbe69956f092d1" |
27 | 27 | ||
28 | # set the same COMPATIBLE_HOST as libhugetlbfs | 28 | # set the same COMPATIBLE_HOST as libhugetlbfs |
29 | COMPATIBLE_HOST = "(i.86|x86_64|powerpc|powerpc64|aarch64|arm).*-linux*" | 29 | COMPATIBLE_HOST = "(i.86|x86_64|powerpc|powerpc64|aarch64|arm).*-linux*" |