| From 7823956149c78e1996c567d1965803456df090f8 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 6cda12c..5514c1c 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; |
| } |
| |