Skip to content

Commit

Permalink
fix: flush for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
mochalins committed Sep 15, 2024
1 parent 3a43dae commit 5c685f9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/backend/posix.zig
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
const builtin = @import("builtin");
const std = @import("std");
const serialport = @import("../serialport.zig");
const c = @cImport({
@cInclude("termios.h");
});

pub const Port = struct {
name: []const u8,
Expand Down Expand Up @@ -141,7 +144,9 @@ fn tcflush(fd: std.posix.fd_t, action: TCFLUSH) !void {
@intFromEnum(action),
);
},
.macos => try std.c.tcflush(fd, @intFromEnum(action)),
.macos => b: {
break :b try c.tcflush(fd, @intFromEnum(action));
},
else => @compileError("tcflush unimplemented on this OS"),
};
return switch (std.posix.errno(result)) {
Expand Down

0 comments on commit 5c685f9

Please sign in to comment.