fix: now builds on stable zig

This commit is contained in:
LordMZTE 2022-05-16 19:00:04 +02:00
parent 4004982281
commit 346196903b
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
3 changed files with 4 additions and 4 deletions

View file

@ -8,7 +8,7 @@ pub const Action = enum {
pub fn execute( pub fn execute(
self: Action, self: Action,
handle_out: *?std.ChildProcess, handle_out: *?*std.ChildProcess,
alloc: std.mem.Allocator, alloc: std.mem.Allocator,
) !void { ) !void {
std.log.info("Executing action {s}", .{@tagName(self)}); std.log.info("Executing action {s}", .{@tagName(self)});
@ -19,7 +19,7 @@ pub const Action = enum {
.hibernate => "hibernate", .hibernate => "hibernate",
} }; } };
var child = std.ChildProcess.init(&argv, alloc); var child = try std.ChildProcess.init(&argv, alloc);
try child.spawn(); try child.spawn();
handle_out.* = child; handle_out.* = child;
} }

View file

@ -5,7 +5,7 @@ const c = ffi.c;
const ffi = @import("ffi.zig"); const ffi = @import("ffi.zig");
pub const GuiState = struct { pub const GuiState = struct {
child: ?std.ChildProcess = null, child: ?*std.ChildProcess = null,
alloc: std.mem.Allocator, alloc: std.mem.Allocator,
/// Allocator used to allocate userdata that will be cleared at the /// Allocator used to allocate userdata that will be cleared at the
/// end of the application lifespan /// end of the application lifespan

View file

@ -64,7 +64,7 @@ pub fn main() !u8 {
); );
if (state.child) |*ch| { if (state.child) |*ch| {
_ = try ch.wait(); _ = try ch.*.wait();
} }
return @intCast(u8, status); return @intCast(u8, status);