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
00d5ca1e
Commit
00d5ca1e
authored
5 years ago
by
Simon McVittie
Browse files
Options
Downloads
Patches
Plain Diff
architecture: Use _srt_get_helper
Signed-off-by:
Simon McVittie
<
smcv@collabora.com
>
parent
93a783d9
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!77
Look for vulkaninfo, wflinfo in SRT_HELPERS_PATH
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
steam-runtime-tools/architecture.c
+11
-9
11 additions, 9 deletions
steam-runtime-tools/architecture.c
with
11 additions
and
9 deletions
steam-runtime-tools/architecture.c
+
11
−
9
View file @
00d5ca1e
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include
"steam-runtime-tools/architecture.h"
#include
"steam-runtime-tools/architecture.h"
#include
"steam-runtime-tools/architecture-internal.h"
#include
"steam-runtime-tools/architecture-internal.h"
#include
"steam-runtime-tools/glib-compat.h"
#include
"steam-runtime-tools/utils.h"
#include
"steam-runtime-tools/utils.h"
#include
"steam-runtime-tools/utils-internal.h"
#include
"steam-runtime-tools/utils-internal.h"
...
@@ -47,7 +48,7 @@ _srt_architecture_can_run (const char *helpers_path,
...
@@ -47,7 +48,7 @@ _srt_architecture_can_run (const char *helpers_path,
const
char
*
multiarch
)
const
char
*
multiarch
)
{
{
gchar
*
helper
=
NULL
;
gchar
*
helper
=
NULL
;
const
gchar
*
argv
[]
=
{
"true"
,
NULL
}
;
GPtrArray
*
argv
=
NULL
;
int
exit_status
=
-
1
;
int
exit_status
=
-
1
;
GError
*
error
=
NULL
;
GError
*
error
=
NULL
;
gboolean
ret
=
FALSE
;
gboolean
ret
=
FALSE
;
...
@@ -58,18 +59,18 @@ _srt_architecture_can_run (const char *helpers_path,
...
@@ -58,18 +59,18 @@ _srt_architecture_can_run (const char *helpers_path,
g_return_val_if_fail
(
multiarch
!=
NULL
,
FALSE
);
g_return_val_if_fail
(
multiarch
!=
NULL
,
FALSE
);
g_return_val_if_fail
(
_srt_check_not_setuid
(),
FALSE
);
g_return_val_if_fail
(
_srt_check_not_setuid
(),
FALSE
);
if
(
helpers_path
==
NULL
)
argv
=
_srt_get_helper
(
helpers_path
,
multiarch
,
"true"
,
helpers_path
=
_srt_get_helpers_path
(
&
error
);
SRT_HELPER_FLAGS_NONE
,
&
error
);
if
(
argv
==
NULL
)
if
(
helpers_path
==
NULL
)
{
{
g_debug
(
"%s"
,
error
->
message
);
g_debug
(
"%s"
,
error
->
message
);
goto
out
;
goto
out
;
}
}
helper
=
g_strdup_printf
(
"%s/%s-true"
,
helpers_path
,
multiarch
);
g_ptr_array_add
(
argv
,
NULL
);
argv
[
0
]
=
helper
;
g_debug
(
"Testing architecture %s with %s"
,
multiarch
,
helper
);
g_debug
(
"Testing architecture %s with %s"
,
multiarch
,
(
const
char
*
)
g_ptr_array_index
(
argv
,
0
));
my_environ
=
g_get_environ
();
my_environ
=
g_get_environ
();
ld_preload
=
g_environ_getenv
(
my_environ
,
"LD_PRELOAD"
);
ld_preload
=
g_environ_getenv
(
my_environ
,
"LD_PRELOAD"
);
...
@@ -80,7 +81,7 @@ _srt_architecture_can_run (const char *helpers_path,
...
@@ -80,7 +81,7 @@ _srt_architecture_can_run (const char *helpers_path,
}
}
if
(
!
g_spawn_sync
(
NULL
,
/* working directory */
if
(
!
g_spawn_sync
(
NULL
,
/* working directory */
(
gchar
**
)
argv
,
(
gchar
**
)
argv
->
pdata
,
my_environ
,
/* envp */
my_environ
,
/* envp */
0
,
/* flags */
0
,
/* flags */
NULL
,
/* child setup */
NULL
,
/* child setup */
...
@@ -107,6 +108,7 @@ out:
...
@@ -107,6 +108,7 @@ out:
g_free
(
helper
);
g_free
(
helper
);
g_free
(
filtered_preload
);
g_free
(
filtered_preload
);
g_clear_error
(
&
error
);
g_clear_error
(
&
error
);
g_clear_pointer
(
&
argv
,
g_ptr_array_unref
);
return
ret
;
return
ret
;
}
}
...
...
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