Skip to content

Commit

Permalink
fix: macos passing baud rate to setspeed fns
Browse files Browse the repository at this point in the history
  • Loading branch information
mochalins committed Sep 23, 2024
1 parent 97b691c commit ea9fd1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/backend/macos.zig
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ pub fn configure(

if (config.input_baud_rate) |ibr| {
switch (std.posix.errno(
c.cfsetospeed(@ptrCast(&settings), config.baud_rate),
c.cfsetospeed(@ptrCast(&settings), @intFromEnum(config.baud_rate)),
)) {
.SUCCESS => {},
else => |err| std.posix.unexpectedErrno(err),
}
switch (std.posix.errno(
c.cfsetispeed(@ptrCast(&settings), ibr),
c.cfsetispeed(@ptrCast(&settings), @intFromEnum(ibr)),
)) {
.SUCCESS => {},
else => |err| std.posix.unexpectedErrno(err),
}
} else {
switch (std.posix.errno(
c.cfsetspeed(@ptrCast(&settings), config.baud_rate),
c.cfsetspeed(@ptrCast(&settings), @intFromEnum(config.baud_rate)),
)) {
.SUCCESS => {},
else => |err| std.posix.unexpectedErrno(err),
Expand Down

0 comments on commit ea9fd1e

Please sign in to comment.