git-annex/Utility/Mounts.hs
Joey Hess f4788f3853
clarify comment
haskell-mountpoints contains android specific code, but it's not used
when git-annex was built for linux and is running on android.
2018-09-05 11:22:27 -04:00

26 lines
626 B
Haskell

{- portability shim for System.MountPoints
-
- Copyright 2016 Joey Hess <id@joeyh.name>
-
- License: BSD-2-clause
-}
{-# LANGUAGE CPP #-}
{-# OPTIONS_GHC -fno-warn-tabs #-}
module Utility.Mounts (getMounts, Mntent(..)) where
import qualified System.MountPoints
import System.MountPoints (Mntent(..))
import Utility.Exception
getMounts :: IO [Mntent]
#ifndef __ANDROID__
getMounts = System.MountPoints.getMounts
-- That will crash when the linux build is running on Android,
-- so fall back to this.
`catchNonAsync` const System.MountPoints.getProcMounts
#else
getMounts = System.MountPoints.getProcMounts
#endif