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