| 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(-) |
| |
| --- a/kexec/arch/i386/x86-linux-setup.c |
| +++ b/kexec/arch/i386/x86-linux-setup.c |
| @@ -332,9 +332,9 @@ static int add_edd_entry(struct x86_linu |
| |
| /* extract the device number */ |
| char* sysfs_name_copy = strdup(sysfs_name); |
| - if (sscanf(basename(sysfs_name_copy), "int13_dev%hhx", &devnum) != 1) { |
| + if (sscanf(strrchr(sysfs_name_copy,'/') + 1, "int13_dev%hhx", &devnum) != 1) { |
| fprintf(stderr, "Invalid format of int13_dev dir " |
| - "entry: %s\n", basename(sysfs_name_copy)); |
| + "entry: %s\n", strrchr(sysfs_name_copy,'/') + 1); |
| free(sysfs_name_copy); |
| return -1; |
| } |