diff options
| author | Vincent Rischmann <vincent@rischmann.fr> | 2021-12-31 20:57:49 +0100 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-01-01 15:37:50 -0500 |
| commit | 0662f1d52204b9c3bce22b3bd72bf4faf2df3559 (patch) | |
| tree | a6e603b273c4e705b05b8717f931497cb1cca26a /lib/std | |
| parent | 885d96735de0fb771403c06d258cac316b792de3 (diff) | |
| download | zig-0662f1d52204b9c3bce22b3bd72bf4faf2df3559.tar.gz zig-0662f1d52204b9c3bce22b3bd72bf4faf2df3559.zip | |
io_uring: fix version check in tests
For renameat, unlinkat, mkdirat, symlinkat and linkat the error code
differs between kernel 5.4 which returns EBADF and kernel 5.10 which returns EINVAL.
Fixes #10466
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/os/linux/io_uring.zig | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/std/os/linux/io_uring.zig b/lib/std/os/linux/io_uring.zig index d2d9e64bda..9dd5aae3ee 100644 --- a/lib/std/os/linux/io_uring.zig +++ b/lib/std/os/linux/io_uring.zig @@ -2471,7 +2471,7 @@ test "renameat" { switch (cqe.err()) { .SUCCESS => {}, // This kernel's io_uring does not yet implement renameat (kernel version < 5.11) - .INVAL => return error.SkipZigTest, + .BADF, .INVAL => return error.SkipZigTest, else => |errno| std.debug.panic("unhandled errno: {}", .{errno}), } try testing.expectEqual(linux.io_uring_cqe{ @@ -2533,7 +2533,7 @@ test "unlinkat" { switch (cqe.err()) { .SUCCESS => {}, // This kernel's io_uring does not yet implement unlinkat (kernel version < 5.11) - .INVAL => return error.SkipZigTest, + .BADF, .INVAL => return error.SkipZigTest, else => |errno| std.debug.panic("unhandled errno: {}", .{errno}), } try testing.expectEqual(linux.io_uring_cqe{ @@ -2579,7 +2579,7 @@ test "mkdirat" { switch (cqe.err()) { .SUCCESS => {}, // This kernel's io_uring does not yet implement mkdirat (kernel version < 5.15) - .INVAL => return error.SkipZigTest, + .BADF, .INVAL => return error.SkipZigTest, else => |errno| std.debug.panic("unhandled errno: {}", .{errno}), } try testing.expectEqual(linux.io_uring_cqe{ @@ -2628,7 +2628,7 @@ test "symlinkat" { switch (cqe.err()) { .SUCCESS => {}, // This kernel's io_uring does not yet implement symlinkat (kernel version < 5.15) - .INVAL => return error.SkipZigTest, + .BADF, .INVAL => return error.SkipZigTest, else => |errno| std.debug.panic("unhandled errno: {}", .{errno}), } try testing.expectEqual(linux.io_uring_cqe{ @@ -2683,7 +2683,7 @@ test "linkat" { switch (cqe.err()) { .SUCCESS => {}, // This kernel's io_uring does not yet implement linkat (kernel version < 5.15) - .INVAL => return error.SkipZigTest, + .BADF, .INVAL => return error.SkipZigTest, else => |errno| std.debug.panic("unhandled errno: {}", .{errno}), } try testing.expectEqual(linux.io_uring_cqe{ |
