execvpe should handle ENOTDIR
If PATH environment variable contains non directory component, execvpe fails by ENOTDIR.
For example, if "/tmp/foo" is a regular file, the following program fails with PATH contains "/tmp/foo".
module Main where
import System.Environment
import System.Posix.Process
main :: IO ()
main = do
env <- getEnvironment
executeFile "echo" True [] (Just env)
return ()
$ PATH=/tmp/foo:$PATH runghc a.hs
a.hs: echo: executeFile: inappropriate type (Not a directory)
See for example, https://github.com/haskell/cabal/issues/1723
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.8.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | libraries/unix |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |