fix errno handle

This commit is contained in:
rhodes-b
2025-02-02 16:27:10 -06:00
parent c5508e7d19
commit bc156266c6

View File

@ -130,7 +130,7 @@ pub fn cloneInto(cgroup: []const u8) !posix.pid_t {
}; };
const rc = linux.syscall2(linux.SYS.clone3, @intFromPtr(&args), @sizeOf(@TypeOf(args))); const rc = linux.syscall2(linux.SYS.clone3, @intFromPtr(&args), @sizeOf(@TypeOf(args)));
return switch (posix.errno(rc)) { return switch (std.os.linux.E.init(rc)) {
.SUCCESS => @as(posix.pid_t, @intCast(rc)), .SUCCESS => @as(posix.pid_t, @intCast(rc)),
else => |errno| err: { else => |errno| err: {
log.err("unable to clone: {}", .{errno}); log.err("unable to clone: {}", .{errno});