summaryrefslogtreecommitdiffstats
path: root/recipes-multimedia/onevpl/onevpl/0001-Fix-basename-build-issue-with-musl_libc.patch
blob: 93e5ed0d379ac13802eb51f9c2cdabb30041ad65 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From d16afe9f9302e4995f12d699019eba170bb6db21 Mon Sep 17 00:00:00 2001
From: "Yew, Chang Ching" <chang.ching.yew@intel.com>
Date: Fri, 8 Oct 2021 08:45:39 +0800
Subject: [PATCH] Fix basename() build issue with musl_libc

Upstream-Status: Submitted
innersource PR #264

Signed-off-by: Yew, Chang Ching <chang.ching.yew@intel.com>
---
 tools/legacy/sample_common/src/vaapi_utils.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/legacy/sample_common/src/vaapi_utils.cpp b/tools/legacy/sample_common/src/vaapi_utils.cpp
index b69dbe44..9382535a 100644
--- a/tools/legacy/sample_common/src/vaapi_utils.cpp
+++ b/tools/legacy/sample_common/src/vaapi_utils.cpp
@@ -7,6 +7,7 @@
 #ifdef LIBVA_SUPPORT
 
     #include "vaapi_utils.h"
+    #include <libgen.h>
     #include <dlfcn.h>
     #include <stdexcept>
 
@@ -26,7 +27,7 @@ SimpleLoader::SimpleLoader(const char* name) {
     dlerror();
     so_handle = dlopen(name, RTLD_GLOBAL | RTLD_NOW);
     if (NULL == so_handle) {
-        so_handle = dlopen(basename(name), RTLD_GLOBAL | RTLD_NOW);
+        so_handle = dlopen(basename((char *)name), RTLD_GLOBAL | RTLD_NOW);
         if (NULL == so_handle) {
             std::cerr << dlerror() << std::endl;
             throw std::runtime_error("Can't load library");
-- 
2.33.0