From a91eeb4070765d2b9908928b7f98515b0b94a11a Mon Sep 17 00:00:00 2001 From: Mikhail Glushenkov <mikhail.glushenkov@gmail.com> Date: Sun, 10 Jul 2016 22:11:24 +0200 Subject: [PATCH] Fix getExecutablePath on *BSD. Fixes #3512. --- cabal-install/Distribution/Client/Compat/ExecutablePath.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cabal-install/Distribution/Client/Compat/ExecutablePath.hs b/cabal-install/Distribution/Client/Compat/ExecutablePath.hs index 3bb7643c21..f3fbfa7167 100644 --- a/cabal-install/Distribution/Client/Compat/ExecutablePath.hs +++ b/cabal-install/Distribution/Client/Compat/ExecutablePath.hs @@ -33,6 +33,7 @@ import Foreign.Marshal.Alloc import Foreign.Ptr import Foreign.Storable import System.Posix.Internals +import System.Directory #endif -- GHC 7.0.* compatibility. 'System.Posix.Internals' in base-4.3.* doesn't @@ -174,6 +175,7 @@ getExecutablePath = -- If argc > 0 then argv[0] is guaranteed by the standard -- to be a pointer to a null-terminated string. then peek p_argv >>= peek >>= peekFilePath + >>= canonicalizePath else error $ "getExecutablePath: " ++ msg where msg = "no OS specific implementation and program name couldn't be " ++ "found in argv" -- GitLab