authorgravatar for thejoshwolfe@gmail.comJosh Wolfe <thejoshwolfe@gmail.com> 2017-11-29 17:52:58-07:00
committergravatar for thejoshwolfe@gmail.comJosh Wolfe <thejoshwolfe@gmail.com> 2017-11-29 17:52:58-07:00
log418b0967fc703dbad484b58bc09390e101219581
treeb9bdfbd4591652a3e4408f323732a6fbf28749e6
parent70662830044418fc2d637c166fc100fe72d60fcf

fix os.Dir compile errors


1 files changed, 3 insertions(+), 2 deletions(-)

std/os/index.zig+3-2
...@@ -939,6 +939,7 @@ start_over:...@@ -939,6 +939,7 @@ start_over:
939}939}
940940
941pub const Dir = struct {941pub const Dir = struct {
942 // See man getdents
942 fd: i32,943 fd: i32,
943 allocator: &Allocator,944 allocator: &Allocator,
944 buf: []u8,945 buf: []u8,
...@@ -981,7 +982,7 @@ pub const Dir = struct {...@@ -981,7 +982,7 @@ pub const Dir = struct {
981982
982 pub fn close(self: &Dir) {983 pub fn close(self: &Dir) {
983 self.allocator.free(self.buf);984 self.allocator.free(self.buf);
984 close(self.fd);985 os.close(self.fd);
985 }986 }
986987
987 /// Memory such as file names referenced in this returned entry becomes invalid988 /// Memory such as file names referenced in this returned entry becomes invalid
...@@ -1013,7 +1014,7 @@ pub const Dir = struct {...@@ -1013,7 +1014,7 @@ pub const Dir = struct {
1013 break;1014 break;
1014 }1015 }
1015 }1016 }
1016 const linux_entry = @ptrCast(&LinuxEntry, &self.buf[self.index]);1017 const linux_entry = @ptrCast(& align(1) LinuxEntry, &self.buf[self.index]);
1017 const next_index = self.index + linux_entry.d_reclen;1018 const next_index = self.index + linux_entry.d_reclen;
1018 self.index = next_index;1019 self.index = next_index;
10191020