diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2017-08-21 23:33:59 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2017-08-21 23:33:59 +0000 |
commit | c94bbcd862946e8a4c7d1db89d9822b494f60c34 (patch) | |
tree | a8e127218a7bdc41e9c158b724670326cc6a8a5e /main | |
parent | 1873e00662cd8e3f0afb7e8766ea9451c4925fb4 (diff) | |
download | aports-c94bbcd862946e8a4c7d1db89d9822b494f60c34.tar.bz2 aports-c94bbcd862946e8a4c7d1db89d9822b494f60c34.tar.xz |
main/libuv: fix tests on s390x
fix is from https://github.com/libuv/libuv/pull/1487
Diffstat (limited to 'main')
-rw-r--r-- | main/libuv/APKBUILD | 6 | ||||
-rw-r--r-- | main/libuv/fix-process-title.patch | 58 |
2 files changed, 62 insertions, 2 deletions
diff --git a/main/libuv/APKBUILD b/main/libuv/APKBUILD index c0e7db964e..74a971afc1 100644 --- a/main/libuv/APKBUILD +++ b/main/libuv/APKBUILD @@ -3,7 +3,7 @@ # Maintainer: Natanael Copa <ncopa@alpinelinux.org> pkgname=libuv pkgver=1.14.0 -pkgrel=0 +pkgrel=1 pkgdesc="Cross-platform asychronous I/O" url="http://libuv.org" arch="all" @@ -12,6 +12,7 @@ makedepends="automake autoconf libtool linux-headers" subpackages="$pkgname-dev $pkgname-dbg" source="http://dist.libuv.org/dist/v$pkgver/$pkgname-v$pkgver.tar.gz disable-setuid-test.patch + fix-process-title.patch " builddir="$srcdir/$pkgname-v$pkgver" @@ -47,4 +48,5 @@ package() { } sha512sums="a84c62021d50bf5a6024d05580243b21850f09123ff1865fc43fb7f2aabf1f65e5a7d9b33e446ca9a75c1b82d5cdad11b35f18cdc26e7323d0f957ac9af4623f libuv-v1.14.0.tar.gz -478d25c8905cd393b9ced0f1b16e70794a7ef20fb9eb212fd74e50beca3f5a33a6a5267616abecf470426ed3d00efec51df468745ff43c0de05c0ad8234f1eb3 disable-setuid-test.patch" +478d25c8905cd393b9ced0f1b16e70794a7ef20fb9eb212fd74e50beca3f5a33a6a5267616abecf470426ed3d00efec51df468745ff43c0de05c0ad8234f1eb3 disable-setuid-test.patch +be729683c3868246d9e4ee0a85073777a6f03a4ec8931eae9a15e0f68dddbef54892224fc5d01dc49e1b101bb0acf2e9a47363b42c9b86edaecf78eff16e0375 fix-process-title.patch" diff --git a/main/libuv/fix-process-title.patch b/main/libuv/fix-process-title.patch new file mode 100644 index 0000000000..ee0bdf8789 --- /dev/null +++ b/main/libuv/fix-process-title.patch @@ -0,0 +1,58 @@ +From fd8e69547a00e69f10d4d4c46a5ff01b49143d2b Mon Sep 17 00:00:00 2001 +From: Matthew Taylor <mstaveleytaylor@gmail.com> +Date: Thu, 17 Aug 2017 18:25:29 +0100 +Subject: [PATCH] unix: modify argv[0] when process title is set + +Ensures that argv[0] is changed when uv_set_process_title is called +Before, on some unix systems uv__set_process_title was being called but +argv[0] was not modified. + +See #1396 for more details. +This partially reverts commit 78c17238f48d9083359206a2215fc63dd7a0283d. +--- + src/unix/proctitle.c | 22 ++++++++-------------- + 1 file changed, 8 insertions(+), 14 deletions(-) + +diff --git a/src/unix/proctitle.c b/src/unix/proctitle.c +index 70e91bfc2..2ed0b21c6 100644 +--- a/src/unix/proctitle.c ++++ b/src/unix/proctitle.c +@@ -48,14 +48,12 @@ char** uv_setup_args(int argc, char** argv) { + for (i = 0; i < argc; i++) + size += strlen(argv[i]) + 1; + +- process_title.str = uv__strdup(argv[0]); +- if (process_title.str == NULL) +- return argv; +- + #if defined(__MVS__) + /* argv is not adjacent. So just use argv[0] */ +- process_title.len = strlen(process_title.str); ++ process_title.str = argv[0]; ++ process_title.len = strlen(argv[0]); + #else ++ process_title.str = argv[0]; + process_title.len = argv[argc - 1] + strlen(argv[argc - 1]) - argv[0]; + assert(process_title.len + 1 == size); /* argv memory should be adjacent. */ + #endif +@@ -83,15 +81,11 @@ char** uv_setup_args(int argc, char** argv) { + + + int uv_set_process_title(const char* title) { +- char* new_title; +- /* Copy the title into our own buffer. We don't want to free the pointer +- * on libuv shutdown because the program might still be using it. */ +- new_title = uv__strdup(title); +- if (new_title == NULL) +- return -ENOMEM; +- uv__free(process_title.str); +- process_title.str = new_title; +- process_title.len = strlen(new_title); ++ if (process_title.len == 0) ++ return 0; ++ ++ /* No need to terminate, byte after is always '\0'. */ ++ strncpy(process_title.str, title, process_title.len); + uv__set_process_title(title); + + return 0; |