Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 1 | --- a/kexec/arch/i386/x86-linux-setup.c |
| 2 | +++ b/kexec/arch/i386/x86-linux-setup.c |
| 3 | @@ -280,9 +280,9 @@ static int add_edd_entry(struct x86_linu |
| 4 | memset(edd_info, 0, sizeof(struct edd_info)); |
| 5 | |
| 6 | /* extract the device number */ |
| 7 | - if (sscanf(basename(sysfs_name), "int13_dev%hhx", &devnum) != 1) { |
| 8 | + if (sscanf(strrchr(sysfs_name,'/') + 1, "int13_dev%hhx", &devnum) != 1) { |
| 9 | fprintf(stderr, "Invalid format of int13_dev dir " |
| 10 | - "entry: %s\n", basename(sysfs_name)); |
| 11 | + "entry: %s\n", strrchr(sysfs_name,'/') + 1); |
| 12 | return -1; |
| 13 | } |
| 14 | |