aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Hoisie <hoisie@gmail.com>2010-12-07 15:57:00 -0500
committerRuss Cox <rsc@golang.org>2010-12-07 15:57:00 -0500
commitbfac91a6b9aee3bc19e8ab0fb0da0e754b53ffa2 (patch)
treefd9408c998ad18ab48098ca045a6e1f5642aa2cd
parent688a83128d1304c2a1fe62416ca7e6d703faad3e (diff)
downloadgo-bfac91a6b9aee3bc19e8ab0fb0da0e754b53ffa2.tar.gz
go-bfac91a6b9aee3bc19e8ab0fb0da0e754b53ffa2.zip
exec.LookPath: return os.PathError instad of os.ENOENT, it's more descriptive.
R=rsc CC=golang-dev https://golang.org/cl/3448042
-rw-r--r--src/pkg/exec/lp_unix.go4
-rw-r--r--src/pkg/exec/lp_windows.go4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/exec/lp_unix.go b/src/pkg/exec/lp_unix.go
index b2feecd10e..292e24fccd 100644
--- a/src/pkg/exec/lp_unix.go
+++ b/src/pkg/exec/lp_unix.go
@@ -29,7 +29,7 @@ func LookPath(file string) (string, os.Error) {
if canExec(file) {
return file, nil
}
- return "", os.ENOENT
+ return "", &os.PathError{"lookpath", file, os.ENOENT}
}
pathenv := os.Getenv("PATH")
for _, dir := range strings.Split(pathenv, ":", -1) {
@@ -41,5 +41,5 @@ func LookPath(file string) (string, os.Error) {
return dir + "/" + file, nil
}
}
- return "", os.ENOENT
+ return "", &os.PathError{"lookpath", file, os.ENOENT}
}
diff --git a/src/pkg/exec/lp_windows.go b/src/pkg/exec/lp_windows.go
index 9d5dc1a144..7b56afa856 100644
--- a/src/pkg/exec/lp_windows.go
+++ b/src/pkg/exec/lp_windows.go
@@ -49,7 +49,7 @@ func LookPath(file string) (string, os.Error) {
if f, ok := canExec(file, exts); ok {
return f, nil
}
- return ``, os.ENOENT
+ return ``, &os.PathError{"lookpath", file, os.ENOENT}
}
if pathenv := os.Getenv(`PATH`); pathenv == `` {
if f, ok := canExec(`.\`+file, exts); ok {
@@ -62,5 +62,5 @@ func LookPath(file string) (string, os.Error) {
}
}
}
- return ``, os.ENOENT
+ return ``, &os.PathError{"lookpath", file, os.ENOENT}
}