summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a394b95)
raw | patch | inline | side by side (parent: a394b95)
author | vwan@ti.com <vwan@ti.com> | |
Tue, 18 Jun 2013 19:18:02 +0000 (12:18 -0700) | ||
committer | Chris Ring <cring@ti.com> | |
Wed, 19 Jun 2013 04:05:44 +0000 (21:05 -0700) |
pathconf() returns error when file is located in /tmp. We switch to using PATH_MAX to avoid this problem.
Signed-off-by: VW <vwan@ti.com>
Signed-off-by: VW <vwan@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 05608df389effa28cb8e802b6b22b392de5a2bd3..6314f59e3d6e5f986049d112f89f07cd612f44d0 100644 (file)
char *user_parm = NULL;
struct stat sbuf;
int i = 0;
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)) {
char * abs_path = NULL;
if (-1 != stat(IPC_DEVICE_PATH, &sbuf)) {
/* Get the abs path for all firmware files */
for (i = 0; i < syslink_num_cores; i++) {
/* 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);
+ abs_path = calloc(1, PATH_MAX + 1);
if (abs_path == NULL) {
return -1;
}
if (abs_path == NULL) {
return -1;
}