Files
tqma6-yocto-mirror/sources/meta-openembedded/meta-initramfs/recipes-devtools/mtd/ubi-utils-klibc-2.0.2/0005-common.h-replace-getline-with-fgets.patch
Siggi (OpenClaw Agent) 16accb6b24 Complete Yocto mirror with license table for TQMa6UL (2038-compliance)
- 264 license table entries with exact download URLs (224/264 resolved)
- Complete sources/ directory with all BitBake recipes
- Build configuration: tqma6ul-multi-mba6ulx, spaetzle (musl)
- Full traceability for Softwarefreigabeantrag
- GCC 13.4.0, Linux 6.6.102, U-Boot 2023.04, musl 1.2.4
- License distribution: GPL-2.0 (24), MIT (23), GPL-2.0+ (18), BSD-3 (16)
2026-03-01 21:14:11 +00:00

57 lines
1.4 KiB
Diff

From 2137eb1a6cd0326510bd3b9faf8037d9bf34ca3d Mon Sep 17 00:00:00 2001
From: Andrea Adami <andrea.adami@gmail.com>
Date: Wed, 23 May 2018 15:52:34 +0200
Subject: [PATCH] common.h: replace getline() with fgets
There is an unofficial upstream patch adding a simple getline()
to libmissing.h. Unfortunately the patch creates issues if the
toolchain is using glibc (autotools cache?) so for the moment
keep the old hack and wait for commits upstream.
Fix:
| ubi-utils/ubiformat.o: In function `prompt.constprop.4':
| ubiformat.c:(.text+0x70): undefined reference to `getline'
Upstream-Status: Inappropriate [klibc specific]
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
---
include/common.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/common.h b/include/common.h
index a1d59d0..96b0bdb 100644
--- a/include/common.h
+++ b/include/common.h
@@ -126,15 +126,26 @@ extern "C" {
*/
static inline bool prompt(const char *msg, bool def)
{
+
+#ifndef __KLIBC__
char *line = NULL;
size_t len;
+#else
+ char *line;
+ const int sizeof_line = 2;
+ line = malloc(sizeof_line);
+#endif
bool ret = def;
do {
normsg_cont("%s (%c/%c) ", msg, def ? 'Y' : 'y', def ? 'n' : 'N');
fflush(stdout);
+#ifndef __KLIBC__
while (getline(&line, &len, stdin) == -1) {
+#else
+ while (fgets(line, sizeof_line, stdin) == NULL) {
+#endif
printf("failed to read prompt; assuming '%s'\n",
def ? "yes" : "no");
break;
--
2.7.4