summaryrefslogtreecommitdiff
path: root/user/xfsprogs/scrub.patch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2024-12-01 07:09:04 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2024-12-01 07:09:04 -0600
commiteb48795fd3e33bf496c1466e2e3ed8135dcce29f (patch)
tree848f07c418f3d335fda22b624edc52c96fd68f8e /user/xfsprogs/scrub.patch
parent65490a3788757ebca8d8c259a2c4a29c875ad765 (diff)
downloadpackages-eb48795fd3e33bf496c1466e2e3ed8135dcce29f.tar.gz
packages-eb48795fd3e33bf496c1466e2e3ed8135dcce29f.tar.bz2
packages-eb48795fd3e33bf496c1466e2e3ed8135dcce29f.tar.xz
packages-eb48795fd3e33bf496c1466e2e3ed8135dcce29f.zip
system/xfsprogs + rdeps: Move to user/
* inih requires Meson, and we don't want to introduce Meson to the system/ ABI, so we need to move it to user/. * This takes xfsprogs with it. This is fine because we still have system/e2fsprogs for a file system on new ports. * As the only dependent of userspace-rcu was xfsprogs, it doesn't need to be present in system/ any more either. Move to user/.
Diffstat (limited to 'user/xfsprogs/scrub.patch')
-rw-r--r--user/xfsprogs/scrub.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/user/xfsprogs/scrub.patch b/user/xfsprogs/scrub.patch
new file mode 100644
index 000000000..a466aab34
--- /dev/null
+++ b/user/xfsprogs/scrub.patch
@@ -0,0 +1,49 @@
+From da3ad6ffc9ecf75ebb734bbb863c1412d11b9beb Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Sat, 10 Aug 2024 21:26:57 -0500
+Subject: [PATCH] xfs_scrub: Use POSIX-conformant strerror_r
+
+When building xfsprogs with musl libc, strerror_r returns int as
+specified in POSIX. This differs from the glibc extension that returns
+char*. Successful calls will return 0, which will be dereferenced as a
+NULL pointer by (v)fprintf.
+
+Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
+---
+ scrub/common.c | 3 ++-
+ scrub/inodes.c | 4 ++--
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/scrub/common.c b/scrub/common.c
+index 283ac84e..bd8bde35 100644
+--- a/scrub/common.c
++++ b/scrub/common.c
+@@ -122,7 +122,8 @@ __str_out(
+ fprintf(stream, "%s%s: %s: ", stream_start(stream),
+ _(err_levels[level].string), descr);
+ if (error) {
+- fprintf(stream, _("%s."), strerror_r(error, buf, DESCR_BUFSZ));
++ strerror_r(error, buf, DESCR_BUFSZ);
++ fprintf(stream, _("%s."), buf);
+ } else {
+ va_start(args, format);
+ vfprintf(stream, format, args);
+diff --git a/scrub/inodes.c b/scrub/inodes.c
+index 16c79cf4..f0e7289c 100644
+--- a/scrub/inodes.c
++++ b/scrub/inodes.c
+@@ -65,9 +65,9 @@ bulkstat_for_inumbers(
+ error = -xfrog_bulkstat(&ctx->mnt, breq);
+ if (error) {
+ char errbuf[DESCR_BUFSZ];
++ strerror_r(error, errbuf, DESCR_BUFSZ);
+
+- str_info(ctx, descr_render(dsc), "%s",
+- strerror_r(error, errbuf, DESCR_BUFSZ));
++ str_info(ctx, descr_render(dsc), "%s", errbuf);
+ }
+
+ /*
+--
+2.40.0
+