summaryrefslogtreecommitdiffstats
path: root/vppinfra/vppinfra/elf_clib.c
diff options
context:
space:
mode:
Diffstat (limited to 'vppinfra/vppinfra/elf_clib.c')
-rw-r--r--vppinfra/vppinfra/elf_clib.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/vppinfra/vppinfra/elf_clib.c b/vppinfra/vppinfra/elf_clib.c
index f3d3b32a8c5..8c705488a4b 100644
--- a/vppinfra/vppinfra/elf_clib.c
+++ b/vppinfra/vppinfra/elf_clib.c
@@ -82,6 +82,9 @@ path_search (char * file)
if (file[0] == '.' || file[0] == '/')
return file;
+ if (getenv("PATH") == 0)
+ return file;
+
ps.path = split_string (getenv ("PATH"), ':');
for (i = 0; i < vec_len (ps.path); i++)
@@ -231,7 +234,10 @@ add_section (struct dl_phdr_info * info, size_t size, void * opaque)
name = path_search (cem->exec_path);
if (! name)
- clib_error ("failed to find %s on PATH", cem->exec_path);
+ {
+ clib_error ("failed to find %s on PATH", cem->exec_path);
+ return 0;
+ }
addr = 0;
}