Use a default hotplug path if the firmware hotplug config file cannot be found.
This commit is contained in:
parent
7c3b4b05c1
commit
630b7a860b
2 changed files with 9 additions and 4 deletions
10
iprlib.c
10
iprlib.c
|
|
@ -10,7 +10,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* $Header: /cvsroot/iprdd/iprutils/iprlib.c,v 1.82 2005/12/14 22:29:10 brking Exp $
|
||||
* $Header: /cvsroot/iprdd/iprutils/iprlib.c,v 1.83 2005/12/15 02:10:07 brking Exp $
|
||||
*/
|
||||
|
||||
#ifndef iprlib_h
|
||||
|
|
@ -4154,8 +4154,12 @@ static int ipr_get_hotplug_dir()
|
|||
file = fopen(FIRMWARE_HOTPLUG_CONFIG_FILE, "r");
|
||||
|
||||
if (!file) {
|
||||
syslog(LOG_ERR, "Failed to open %s. %m\n", FIRMWARE_HOTPLUG_CONFIG_FILE);
|
||||
return -EIO;
|
||||
hotplug_dir = realloc(hotplug_dir, strlen(FIRMWARE_HOTPLUG_DEFAULT_DIR) + 1);
|
||||
if (!hotplug_dir)
|
||||
return -ENOMEM;
|
||||
|
||||
strcpy(hotplug_dir, FIRMWARE_HOTPLUG_DEFAULT_DIR);
|
||||
return 0;
|
||||
}
|
||||
|
||||
clearerr(file);
|
||||
|
|
|
|||
3
iprlib.h
3
iprlib.h
|
|
@ -12,7 +12,7 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* $Header: /cvsroot/iprdd/iprutils/iprlib.h,v 1.68 2005/12/07 23:27:52 brking Exp $
|
||||
* $Header: /cvsroot/iprdd/iprutils/iprlib.h,v 1.69 2005/12/15 02:10:07 brking Exp $
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
|
|
@ -62,6 +62,7 @@
|
|||
|
||||
#define FIRMWARE_HOTPLUG_DIR_TAG "FIRMWARE_DIR"
|
||||
#define FIRMWARE_HOTPLUG_CONFIG_FILE "/etc/hotplug/firmware.agent"
|
||||
#define FIRMWARE_HOTPLUG_DEFAULT_DIR LINUX_UCODE_BASE_DIR
|
||||
|
||||
#define IOCTL_BUFFER_SIZE 512
|
||||
#define IPR_MAX_NUM_BUSES 4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue