mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +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,23 +1,3 @@
|
||||
/*
|
||||
* The free space a library reports.
|
||||
*
|
||||
* A library's games can live somewhere the folder that names the library does not. The card
|
||||
* library is exactly that: its steamapps/common is bound to the card, but the directory above it
|
||||
* belongs to the runtime image in the phone's own storage, and that directory is what the client
|
||||
* measures. So it offers both install locations with the phone's free space against each, and the
|
||||
* card's real figure - seventeen gigabytes more, on the device this was found on - never appears.
|
||||
*
|
||||
* The number is not only cosmetic: the client refuses an install it believes will not fit. Once
|
||||
* the phone fills up it would turn down a card install with room to spare, and say nothing about
|
||||
* why.
|
||||
*
|
||||
* Moving the whole library onto the card would fix the number and break something worse. The
|
||||
* prefixes under steamapps/compatdata want symlinks and file locks, and the card is served over
|
||||
* FUSE, which gives us neither - that is why they are kept in the runtime image in the first
|
||||
* place. So the question is answered where the content actually is: a query about a library root
|
||||
* named in BL_LIBRARY_SPACE is served from its steamapps/common, the bind that points at the
|
||||
* card. Every other path is passed through untouched.
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
#include <dlfcn.h>
|
||||
#include <stddef.h>
|
||||
@@ -26,8 +6,6 @@
|
||||
#include <sys/statfs.h>
|
||||
#include <sys/statvfs.h>
|
||||
|
||||
/* A library root, or its steamapps, resolved to the directory that holds the games. Returns the
|
||||
* rewritten path in `buf`, or NULL when `path` is not one of ours and should be left alone. */
|
||||
static const char *content_of(const char *path, char *buf, size_t len) {
|
||||
const char *roots = getenv("BL_LIBRARY_SPACE");
|
||||
if (!path || !roots || !*roots)
|
||||
@@ -38,8 +16,6 @@ static const char *content_of(const char *path, char *buf, size_t len) {
|
||||
const char *end = strchr(roots, ':');
|
||||
size_t root_len = end ? (size_t)(end - roots) : strlen(roots);
|
||||
if (root_len > 0) {
|
||||
/* The root itself, or the steamapps directly beneath it. Anything deeper is already inside
|
||||
* a bind and answers for itself. */
|
||||
int match = (path_len == root_len && !strncmp(path, roots, root_len)) ||
|
||||
(path_len == root_len + 10 && !strncmp(path, roots, root_len) &&
|
||||
!strcmp(path + root_len, "/steamapps"));
|
||||
|
||||
Reference in new issue
Block a user