-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
incus: apply upstream patch for 32bit
- Loading branch information
dkwo
committed
Nov 19, 2024
1 parent
bf86f50
commit 912f409
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
srcpkgs/incus/patches/afa91aaa5d0f7c95a69a17428e1974ebbf34ecdf.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
From afa91aaa5d0f7c95a69a17428e1974ebbf34ecdf Mon Sep 17 00:00:00 2001 | ||
From: Christian Brauner <brauner@kernel.org> | ||
Date: Tue, 19 Nov 2024 15:42:18 +0100 | ||
Subject: [PATCH] cgo/process_utils: fix 32bit builds | ||
|
||
New clang-14 reports errors for directly casting from an integer to a | ||
pointer. Use uintptr_t to fix that problem and adhere to the casting | ||
rules. | ||
|
||
Fixes: https://github.com/lxc/incus/issues/1395 | ||
Signed-off-by: Christian Brauner <brauner@kernel.org> | ||
--- | ||
shared/cgo/process_utils.h | 6 ++++-- | ||
1 file changed, 4 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/shared/cgo/process_utils.h b/shared/cgo/process_utils.h | ||
index 3e1c400c539..19443e921fa 100644 | ||
--- a/shared/cgo/process_utils.h | ||
+++ b/shared/cgo/process_utils.h | ||
@@ -219,9 +219,11 @@ static inline int setproctitle(char *title) | ||
ret = prctl(PR_SET_MM, prctl_arg(PR_SET_MM_MAP), prctl_arg(&prctl_map), | ||
prctl_arg(sizeof(prctl_map)), prctl_arg(0)); | ||
if (ret == 0) { | ||
- char *dest = (char *)arg_start; | ||
+ char *dest; | ||
+ | ||
+ dest = (char *)(uintptr_t)arg_start; | ||
memcpy(dest, title, len - 1); | ||
- dest[len-1] = '\0'; | ||
+ dest[len - 1] = '\0'; | ||
} | ||
|
||
return ret; |