fix: now builds on stable zig
This commit is contained in:
parent
4004982281
commit
346196903b
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue