1
0
Fork 0
mirror of https://gitlab.postmarketos.org/postmarketOS/pmaports.git synced 2025-07-12 16:19:48 +03:00
pmaports/main/dtbtool-exynos/0004-scan_dtb_path-be-less-verbose-when-scanning-director.patch
Henrik Grimler 481e494cdc
main/dtbtool-exynos: fix unreliable behaviour
Hopefully these can be merged in the repo we track, but let's add them
to pmaports in the meanwhile.

Fixes issue where allocated, but non-set memory is used, which gives
unpredictable behaviour.

Part-of: https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/6746
[ci:skip-build]: already built successfully in CI
2025-07-11 22:03:33 +02:00

46 lines
1.4 KiB
Diff

From 129bdc748223beb81a5cc516077909671a86e192 Mon Sep 17 00:00:00 2001
From: Henrik Grimler <henrik@grimler.se>
Date: Mon, 30 Jun 2025 16:33:47 +0200
Subject: [PATCH] scan_dtb_path: be less verbose when scanning directories
And add spaces between each printf arg.
---
dtbtool-exynos.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/dtbtool-exynos.c b/dtbtool-exynos.c
index 0e40e4036846..017f6d3bc408 100644
--- a/dtbtool-exynos.c
+++ b/dtbtool-exynos.c
@@ -129,14 +129,13 @@ static void *scan_dtb_path(char **dtb_files, const char *dtb_path)
if (files < 0)
error("failed to open '%s': %s", dtb_path, strerror(errno));
-
- printf("%s","List of files:\n############################################");
+ printf("Scanning directory %s...\n", dtb_path);
for (f = 0, i = 0; f < files; f++) {
- printf("%s",de[f]->d_name);
+ printf("%s", de[f]->d_name);
namlen = strlen(de[f]->d_name);
if (namlen < 4 || strcmp(&de[f]->d_name[namlen - 4], ".dtb")) {
- printf("%s"," : skipped");
+ printf("%s", " : skipped");
goto next_f;
}
@@ -153,9 +152,8 @@ static void *scan_dtb_path(char **dtb_files, const char *dtb_path)
snprintf(dtb_files[i], namlen, "%s/%s", dtb_path, de[f]->d_name);
next_f:
free(de[f]);
- printf("%s\n","");
+ printf("%s\n", "");
}
- printf("%s\n","End list of files\n#######################################");
return 0;
}
--
2.50.0