From 3cac19e4ec6aa96a404dbddb7bb8c07ebc582859 Mon Sep 17 00:00:00 2001 From: Jianhui Zhao Date: Sat, 4 May 2024 20:32:04 +0800 Subject: [PATCH] rtty: update to 8.1.2 Signed-off-by: Jianhui Zhao --- utils/rtty/Makefile | 4 +- ...upport-POSIX-basename-from-musl-libc.patch | 91 ------------------- 2 files changed, 2 insertions(+), 93 deletions(-) delete mode 100644 utils/rtty/patches/0001-Support-POSIX-basename-from-musl-libc.patch diff --git a/utils/rtty/Makefile b/utils/rtty/Makefile index 3ace47d577..4ce8296802 100644 --- a/utils/rtty/Makefile +++ b/utils/rtty/Makefile @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rtty -PKG_VERSION:=8.1.1 +PKG_VERSION:=8.1.2 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL=https://github.com/zhaojh329/rtty/releases/download/v$(PKG_VERSION) -PKG_HASH:=077dd5d2939db2c09419aaba56cb99bf3cdd14ec4e88e99c7ff9e50df8a3d7f1 +PKG_HASH:=522b0fc5e032c3b84ac707abce8ac4ff5609900011f8f300ce4f4246abac0acc PKG_MAINTAINER:=Jianhui Zhao PKG_LICENSE:=MIT diff --git a/utils/rtty/patches/0001-Support-POSIX-basename-from-musl-libc.patch b/utils/rtty/patches/0001-Support-POSIX-basename-from-musl-libc.patch deleted file mode 100644 index 8493557e7c..0000000000 --- a/utils/rtty/patches/0001-Support-POSIX-basename-from-musl-libc.patch +++ /dev/null @@ -1,91 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Hauke Mehrtens -Date: Sun, 14 Apr 2024 16:06:15 +0200 -Subject: Support POSIX basename() from musl libc - -Musl libc 1.2.5 removed the definition of the basename() function from -string.h and only provides it in libgen.h as the POSIX standard -defines it. - -This change fixes compilation with musl libc 1.2.5. -```` -build_dir/target-mips_24kc_musl/rtty-mbedtls/rtty-8.1.1/src/file.c:156:24: error: implicit declaration of function 'basename' [-Werror=implicit-function-declaration] - 156 | const char *name = basename(path); - | ^~~~~~~~ -```` - -basename() modifies the input string, copy it first with strdup(), If -strdup() returns NULL the code will handle it. - -Signed-off-by: Hauke Mehrtens ---- - src/file.c | 8 +++++++- - src/filectl.c | 6 +++++- - 2 files changed, 12 insertions(+), 2 deletions(-) - ---- a/src/file.c -+++ b/src/file.c -@@ -29,6 +29,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -153,13 +154,17 @@ static int start_upload_file(struct file - { - struct tty *tty = container_of(ctx, struct tty, file); - struct rtty *rtty = tty->rtty; -- const char *name = basename(path); -+ const char *name; - struct stat st; - int fd; -+ char *dirc; - -+ dirc = strdup(path); -+ name = basename(dirc); - fd = open(path, O_RDONLY); - if (fd < 0) { - log_err("open '%s' fail: %s\n", path, strerror(errno)); -+ free(dirc); - return -1; - } - -@@ -177,6 +182,7 @@ static int start_upload_file(struct file - ctx->remain_size = st.st_size; - - log_info("upload file: %s, size: %" PRIu64 "\n", path, (uint64_t)st.st_size); -+ free(dirc); - - return 0; - } ---- a/src/filectl.c -+++ b/src/filectl.c -@@ -30,6 +30,7 @@ - #include - #include - #include -+#include - - #include "utils.h" - #include "file.h" -@@ -75,6 +76,7 @@ static void handle_file_control_msg(int - { - struct file_control_msg msg; - struct buffer b = {}; -+ char *dirc; - - while (true) { - if (buffer_put_fd(&b, fd, -1, NULL) < 0) -@@ -90,7 +92,9 @@ static void handle_file_control_msg(int - if (sfd > -1) { - close(sfd); - gettimeofday(&start_time, NULL); -- printf("Transferring '%s'...Press Ctrl+C to cancel\n", basename(path)); -+ dirc = strdup(path); -+ printf("Transferring '%s'...Press Ctrl+C to cancel\n", basename(dirc)); -+ free(dirc); - - if (total_size == 0) { - printf(" 100%% 0 B 0s\n");