io.test: close memfd at end of test

This commit is contained in:
Luna 2019-12-31 15:35:17 -03:00 committed by Andrew Kelley
parent 13c9faaa2d
commit a153a972ad
No known key found for this signature in database
GPG Key ID: 7C5F548F728501A9

View File

@ -654,6 +654,7 @@ test "memfd_create" {
if (builtin.os != .linux) return error.SkipZigTest;
const fd = try std.os.memfd_create("test", 0);
defer std.os.close(fd);
try std.os.write(fd, "test");
try std.os.lseek_SET(fd, 0);