blob: 0d0ed23c9091254c65bdfda9b4424723014024ee [file] [log] [blame]
From 5f47c30759684cea9a7a409646686c1a358b78ac Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Wed, 11 Apr 2018 22:51:05 +0200
Subject: [PATCH] replace basename() with sscanf()
klibc lacks basename()
Upstream-Status: Inappropriate [klibc specific]
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
---
kexec/arch/i386/x86-linux-setup.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kexec/arch/i386/x86-linux-setup.c b/kexec/arch/i386/x86-linux-setup.c
index 6c7d260..7850083 100644
--- a/kexec/arch/i386/x86-linux-setup.c
+++ b/kexec/arch/i386/x86-linux-setup.c
@@ -304,9 +304,9 @@ static int add_edd_entry(struct x86_linux_param_header *real_mode,
memset(edd_info, 0, sizeof(struct edd_info));
/* extract the device number */
- if (sscanf(basename(sysfs_name), "int13_dev%hhx", &devnum) != 1) {
+ if (sscanf(strrchr(sysfs_name,'/') + 1, "int13_dev%hhx", &devnum) != 1) {
fprintf(stderr, "Invalid format of int13_dev dir "
- "entry: %s\n", basename(sysfs_name));
+ "entry: %s\n", strrchr(sysfs_name,'/') + 1);
return -1;
}