blob: 568f19758a885cc9723cdc9cc16e86b1a4db4201 [file] [log] [blame]
Brad Bishop26bdd442019-08-16 17:08:17 -04001From 7823956149c78e1996c567d1965803456df090f8 Mon Sep 17 00:00:00 2001
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08002From: 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
Brad Bishop26bdd442019-08-16 17:08:17 -040016index 6cda12c..5514c1c 100644
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080017--- 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