Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
steam-runtime-tools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steamrt
steam-runtime-tools
Commits
78f85437
Commit
78f85437
authored
3 years ago
by
Simon McVittie
Browse files
Options
Downloads
Patches
Plain Diff
pv-adverb: Factor out ptr_array_add_unique
Signed-off-by:
Simon McVittie
<
smcv@collabora.com
>
parent
01319118
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!350
pv-adverb: Improve LD_AUDIT, LD_PRELOAD handling
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pressure-vessel/adverb.c
+18
-4
18 additions, 4 deletions
pressure-vessel/adverb.c
with
18 additions
and
4 deletions
pressure-vessel/adverb.c
+
18
−
4
View file @
78f85437
...
@@ -86,6 +86,22 @@ static PreloadModule opt_preload_modules[] =
...
@@ -86,6 +86,22 @@ static PreloadModule opt_preload_modules[] =
{
"LD_PRELOAD"
,
NULL
},
{
"LD_PRELOAD"
,
NULL
},
};
};
static
gpointer
generic_strdup
(
gpointer
p
)
{
return
g_strdup
(
p
);
}
static
void
ptr_array_add_unique
(
GPtrArray
*
arr
,
const
void
*
item
,
GEqualFunc
equal_func
,
GBoxedCopyFunc
copy_func
)
{
if
(
!
g_ptr_array_find_with_equal_func
(
arr
,
item
,
equal_func
,
NULL
))
g_ptr_array_add
(
arr
,
copy_func
((
gpointer
)
item
));
}
static
void
static
void
lib_temp_dirs_free
(
LibTempDirs
*
lib_temp_dirs
)
lib_temp_dirs_free
(
LibTempDirs
*
lib_temp_dirs
)
{
{
...
@@ -1026,10 +1042,8 @@ main (int argc,
...
@@ -1026,10 +1042,8 @@ main (int argc,
goto
out
;
goto
out
;
}
}
g_debug
(
"created symlink %s -> %s"
,
link
,
preload
);
g_debug
(
"created symlink %s -> %s"
,
link
,
preload
);
ptr_array_add_unique
(
search_path
,
platform_overlay_path
,
if
(
!
g_ptr_array_find_with_equal_func
(
search_path
,
platform_overlay_path
,
g_str_equal
,
generic_strdup
);
g_str_equal
,
NULL
))
g_ptr_array_add
(
search_path
,
g_strdup
(
platform_overlay_path
));
}
}
else
else
{
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment