summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e739ea6)
raw | patch | inline | side by side (parent: e739ea6)
author | Angela Stegmaier <angelabaker@ti.com> | |
Thu, 30 May 2013 18:52:38 +0000 (13:52 -0500) | ||
committer | Chris Ring <cring@ti.com> | |
Sun, 9 Jun 2013 22:33:52 +0000 (15:33 -0700) |
Save the absolute path of the firmware file to use
when loading the firmware.
This is useful for the recovery situation, where the
relative path will no longer work.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
when loading the firmware.
This is useful for the recovery situation, where the
relative path will no longer work.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c | patch | blob | history |
diff --git a/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c b/qnx/src/ipc3x_dev/ti/syslink/build/Qnx/resmgr/syslink_main.c
index cb36489a7c968e9de03f6bcb66fc196c92423037..05608df389effa28cb8e802b6b22b392de5a2bd3 100644 (file)
uint32_t hib_timeout = PM_HIB_DEFAULT_TIME;
char *user_parm = NULL;
struct stat sbuf;
+ int i = 0;
+ long max_path_length = 0;
+ char * abs_path = NULL;
if (-1 != stat(IPC_DEVICE_PATH, &sbuf)) {
printf ("Syslink Already Running...\n");
return (error);
}
+ /* Get the abs path for all firmware files */
+ for (i = 0; i < syslink_num_cores; i++) {
+ max_path_length = pathconf( syslink_firmware[i].firmware, _PC_PATH_MAX );
+ if(max_path_length == -1) {
+ perror("pathconf failed");
+ return -1;
+ }
+
+ abs_path = calloc(1, max_path_length + 1);
+ if (abs_path == NULL) {
+ return -1;
+ }
+ if (NULL == realpath(syslink_firmware[i].firmware, abs_path)) {
+ fprintf (stderr, "realpath failed\n");
+ return -1;
+ }
+ syslink_firmware[i].firmware = abs_path;
+ }
+
/* allocate the device structure */
if (NULL == (dev = calloc(1, sizeof(syslink_dev_t)))) {
Osal_printf("syslink: calloc() failed");