mirror of
https://github.com/reactos/syzkaller.git
synced 2025-02-17 18:17:31 +00:00
pkg/osutil: fix IsExist
Currently it returns true for "/some/existing/file/foo" because that returns ENOTDIR.
This commit is contained in:
parent
b6e969be7a
commit
4799d21e01
@ -74,7 +74,7 @@ func Abs(path string) string {
|
|||||||
// IsExist returns true if the file name exists.
|
// IsExist returns true if the file name exists.
|
||||||
func IsExist(name string) bool {
|
func IsExist(name string) bool {
|
||||||
_, err := os.Stat(name)
|
_, err := os.Stat(name)
|
||||||
return err == nil || !os.IsNotExist(err)
|
return err == nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// HandleInterrupts closes shutdown chan on first SIGINT
|
// HandleInterrupts closes shutdown chan on first SIGINT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user