Browse Source

make -vet happy

jason 3 years ago
parent
commit
d1499f3f78
1 changed files with 6 additions and 0 deletions
  1. 6 0
      core/os/os2/file_linux.odin

+ 6 - 0
core/os/os2/file_linux.odin

@@ -370,6 +370,9 @@ _is_file :: proc(name: string) -> bool {
 	}
 	}
 	s: _Stat
 	s: _Stat
 	res := unix.sys_stat(name_cstr, &s)
 	res := unix.sys_stat(name_cstr, &s)
+	if res < 0 {
+		return false
+	}
 	return S_ISREG(s.mode)
 	return S_ISREG(s.mode)
 }
 }
 
 
@@ -389,6 +392,9 @@ _is_dir :: proc(name: string) -> bool {
 	}
 	}
 	s: _Stat
 	s: _Stat
 	res := unix.sys_stat(name_cstr, &s)
 	res := unix.sys_stat(name_cstr, &s)
+	if res < 0 {
+		return false
+	}
 	return S_ISDIR(s.mode)
 	return S_ISDIR(s.mode)
 }
 }