mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 22:05:59 +00:00
cleanup (#764)
This commit is contained in:
1 parent
4163b31b02
commit
83ec5708ed
852 files changed
+4844
-46144
No files matched your search
@@ -1,21 +1,7 @@
|
||||
/*
|
||||
* Ported from WinNative (maxjivi05, feature/wayland-gamescope, 2026-09-18/19), GPL-3.0, with names
|
||||
* changed to this project's. The reasoning below is the original author's.
|
||||
*
|
||||
* A process status without the container's tracer in it.
|
||||
*
|
||||
* proot runs the session under ptrace, so every process here reads a TracerPid in its
|
||||
* /proc/<pid>/status. The Steam client takes that to mean a debugger is attached, and its arm64
|
||||
* build breaks into the supposed debugger with a bare "svc #0" after every failed assertion. That
|
||||
* is no breakpoint: the registers still hold the call Plat_IsInDebugSession() just made, close(),
|
||||
* with its own result, 1, as the argument - so each assertion closes descriptor 1. The number then
|
||||
* goes to whatever the client opens next, and its standard output is written into that: app
|
||||
* manifests and content chunks, its own connections, and the socket a game's Steam API talks
|
||||
* over, which is how a game that stayed silent while loading found its pipe dead.
|
||||
*
|
||||
* The tracer is part of the container, not something a program should react to, so the status
|
||||
* files are served with TracerPid 0.
|
||||
* Ported from WinNative (maxjivi05, feature/wayland-gamescope, 2026-09-18/19), GPL-3.0.
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
@@ -34,7 +20,6 @@ static const char *skip_digits(const char *s) {
|
||||
return end == s ? NULL : end;
|
||||
}
|
||||
|
||||
/* /proc/{self,thread-self,<pid>}[/task/<tid>]/status */
|
||||
static int is_status_path(const char *path) {
|
||||
const char *rest;
|
||||
if (path == NULL || strncmp(path, "/proc/", 6) != 0) return 0;
|
||||
@@ -46,9 +31,6 @@ static int is_status_path(const char *path) {
|
||||
return strcmp(rest, "/status") == 0;
|
||||
}
|
||||
|
||||
/* Chromium stands its hang watchdogs down when it sees a tracer, and the client's web helper does
|
||||
* not come up within their patience here: it is left reading the truth. SteamVR's web helper (the
|
||||
* dashboard, Cardboard mode's SteamVR) is the same Chromium and stalls the same way. */
|
||||
static int is_web_helper(void) {
|
||||
return strcmp(program_invocation_short_name, "steamwebhelper") == 0 ||
|
||||
strcmp(program_invocation_short_name, "vrwebhelper") == 0;
|
||||
@@ -65,8 +47,6 @@ static int write_all(int fd, const char *data, size_t len) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* The descriptor to hand back for a read-only open of a status file, or -1 with errno untouched
|
||||
* when the path is something else or the copy cannot be made, and the real open should run. */
|
||||
__attribute__((visibility("hidden"))) int bl_status_without_tracer(const char *path, int flags) {
|
||||
char text[STATUS_MAX];
|
||||
size_t len = 0;
|
||||
|
||||
Reference in new issue
Block a user