diff options
| author | Josh Wolfe <thejoshwolfe@gmail.com> | 2017-11-29 17:52:58 -0700 |
|---|---|---|
| committer | Josh Wolfe <thejoshwolfe@gmail.com> | 2017-11-29 17:52:58 -0700 |
| commit | 418b0967fc703dbad484b58bc09390e101219581 (patch) | |
| tree | b9bdfbd4591652a3e4408f323732a6fbf28749e6 /std | |
| parent | 70662830044418fc2d637c166fc100fe72d60fcf (diff) | |
| download | zig-418b0967fc703dbad484b58bc09390e101219581.tar.gz zig-418b0967fc703dbad484b58bc09390e101219581.zip | |
fix os.Dir compile errors
Diffstat (limited to 'std')
| -rw-r--r-- | std/os/index.zig | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/std/os/index.zig b/std/os/index.zig index e6a5fc4d15..361750aedc 100644 --- a/std/os/index.zig +++ b/std/os/index.zig @@ -939,6 +939,7 @@ start_over: } pub const Dir = struct { + // See man getdents fd: i32, allocator: &Allocator, buf: []u8, @@ -981,7 +982,7 @@ pub const Dir = struct { pub fn close(self: &Dir) { self.allocator.free(self.buf); - close(self.fd); + os.close(self.fd); } /// Memory such as file names referenced in this returned entry becomes invalid @@ -1013,7 +1014,7 @@ pub const Dir = struct { break; } } - const linux_entry = @ptrCast(&LinuxEntry, &self.buf[self.index]); + const linux_entry = @ptrCast(& align(1) LinuxEntry, &self.buf[self.index]); const next_index = self.index + linux_entry.d_reclen; self.index = next_index; |
