gamemode: Small fix for initLinuxGamemode()

This commit is contained in:
PiergiorgioZagaria 2022-07-28 11:32:53 +02:00 committed by Stephen Gutekanst
parent 80270a5cfc
commit 76bf493a86

View file

@ -52,7 +52,7 @@ pub const Platform = struct {
}; };
} }
pub fn init(allocator: std.mem.Allocator, core: *Core) !Platform { pub fn init(allocator: std.mem.Allocator, core: *Core) !Platform {
initLinuxGamemode(allocator); try initLinuxGamemode(allocator);
const options = core.options; const options = core.options;
const backend_type = try util.detectBackendType(allocator); const backend_type = try util.detectBackendType(allocator);
@ -227,7 +227,7 @@ pub const Platform = struct {
platform.deinitLinuxGamemode(); platform.deinitLinuxGamemode();
} }
fn initLinuxGamemode(allocator: *std.mem.Allocator) void { fn initLinuxGamemode(allocator: std.mem.Allocator) error{ OutOfMemory, InvalidUtf8 }!void {
if (builtin.os.tag == .linux) { if (builtin.os.tag == .linux) {
const gamemode = @import("gamemode"); const gamemode = @import("gamemode");
const GAMEMODE_ENV = try getEnvVarOwned(allocator, "GAMEMODE"); const GAMEMODE_ENV = try getEnvVarOwned(allocator, "GAMEMODE");