Browse Source

Fix os_linux stat

Tyler Erickson 5 years ago
parent
commit
2817bab494
1 changed files with 6 additions and 6 deletions
  1. 6 6
      core/os/os_linux.odin

+ 6 - 6
core/os/os_linux.odin

@@ -197,9 +197,9 @@ Stat :: struct {
 	block_size:    i64, // Optimal bllocksize for I/O
 	block_size:    i64, // Optimal bllocksize for I/O
 	blocks:        i64, // Number of 512-byte blocks allocated
 	blocks:        i64, // Number of 512-byte blocks allocated
 
 
-	last_access:   _File_Time, // Time of last access
-	modified:      _File_Time, // Time of last modification
-	status_change: _File_Time, // Time of last status change
+	last_access:   File_Time, // Time of last access
+	status_change: File_Time, // Time of last status change
+	modified:      File_Time, // Time of last modification
 
 
 	_reserve1,
 	_reserve1,
 	_reserve2,
 	_reserve2,
@@ -266,7 +266,7 @@ foreign libc {
 	@(link_name="lseek64")          _unix_seek          :: proc(fd: Handle, offset: i64, whence: i32) -> i64 ---;
 	@(link_name="lseek64")          _unix_seek          :: proc(fd: Handle, offset: i64, whence: i32) -> i64 ---;
 	@(link_name="gettid")           _unix_gettid        :: proc() -> u64 ---;
 	@(link_name="gettid")           _unix_gettid        :: proc() -> u64 ---;
 	@(link_name="getpagesize")      _unix_getpagesize   :: proc() -> i32 ---;
 	@(link_name="getpagesize")      _unix_getpagesize   :: proc() -> i32 ---;
-	@(link_name="stat")             _unix_stat          :: proc(path: cstring, stat: ^Stat) -> int ---;
+	@(link_name="stat64")           _unix_stat          :: proc(path: cstring, stat: ^Stat) -> int ---;
 	@(link_name="fstat")            _unix_fstat         :: proc(fd: Handle, stat: ^Stat) -> int ---;
 	@(link_name="fstat")            _unix_fstat         :: proc(fd: Handle, stat: ^Stat) -> int ---;
 	@(link_name="access")           _unix_access        :: proc(path: cstring, mask: int) -> int ---;
 	@(link_name="access")           _unix_access        :: proc(path: cstring, mask: int) -> int ---;
 
 
@@ -362,7 +362,7 @@ last_write_time :: proc(fd: Handle) -> (File_Time, Errno) {
 	if err != ERROR_NONE {
 	if err != ERROR_NONE {
 		return 0, err;
 		return 0, err;
 	}
 	}
-	return File_Time(s.modified.nanoseconds), ERROR_NONE;
+	return File_Time(s.modified), ERROR_NONE;
 }
 }
 
 
 last_write_time_by_name :: proc(name: string) -> (File_Time, Errno) {
 last_write_time_by_name :: proc(name: string) -> (File_Time, Errno) {
@@ -370,7 +370,7 @@ last_write_time_by_name :: proc(name: string) -> (File_Time, Errno) {
 	if err != ERROR_NONE {
 	if err != ERROR_NONE {
 		return 0, err;
 		return 0, err;
 	}
 	}
-	return File_Time(s.modified.nanoseconds), ERROR_NONE;
+	return File_Time(s.modified), ERROR_NONE;
 }
 }
 
 
 stat :: inline proc(path: string) -> (Stat, Errno) {
 stat :: inline proc(path: string) -> (Stat, Errno) {