sysutils/reptyr: Fix buld under LLVM 13 on FreeBSD

Fix the following error under LLVM 13 on FreeBSD.

In file included from platform/freebsd/freebsd_ptrace.c:69:
In file included from platform/freebsd/arch/amd64.h:23:
platform/freebsd/arch/x86_common.h:45:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
        int ret;
            ^
platform/freebsd/arch/x86_common.h:54:6: error: variable 'ret' set but not used [-Werror,-Wunused-but-set-variable]
        int ret;
            ^
2 errors generated.

This patch has been submitted to upstream in pull request
https://github.com/nelhage/reptyr/pull/134.

MFH after:	1 week
This commit is contained in:
Cy Schubert 2021-12-01 20:03:49 -08:00
parent 2778a12ebb
commit db939cf001
1 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,27 @@
--- platform/freebsd/arch/x86_common.h.orig 2020-09-29 14:29:59.000000000 -0700
+++ platform/freebsd/arch/x86_common.h 2021-12-01 19:58:27.954536000 -0800
@@ -42,21 +42,19 @@
}
static inline unsigned long arch_get_register(struct ptrace_child *child, unsigned long oft){
- int ret;
struct reg regs;
- ret = ptrace_command(child, PT_GETREGS, &regs);
+ (void) ptrace_command(child, PT_GETREGS, &regs);
return *ptr(&regs,oft);
}
static inline void arch_set_register(struct ptrace_child *child, unsigned long oft, unsigned long val){
- int ret;
struct reg regs;
- ret = ptrace_command(child, PT_GETREGS, &regs);
+ (void) ptrace_command(child, PT_GETREGS, &regs);
*ptr(&regs,oft)=val;
- ret = ptrace_command(child, PT_SETREGS, &regs);
+ (void) ptrace_command(child, PT_SETREGS, &regs);
}
static inline int arch_save_syscall(struct ptrace_child *child) {