diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-06-24 16:02:52 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-06-24 16:02:52 +0100 |
| commit | 362068b534ffefcb87debd4d56b56645f3e25f21 (patch) | |
| tree | 24310294873832de56272632d490afe63876dc4e /src/lib/cross.cc | |
| parent | f1f25e57c97a6ea28513820912169305795c7d14 (diff) | |
Add logging of mount formats in Linux.
Diffstat (limited to 'src/lib/cross.cc')
| -rw-r--r-- | src/lib/cross.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/lib/cross.cc b/src/lib/cross.cc index a642915f4..895fb0ac2 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -24,6 +24,7 @@ #include "log.h" #ifdef DVDOMATIC_POSIX #include <unistd.h> +#include <mntent.h> #endif #ifdef DVDOMATIC_WINDOWS #include <windows.h> @@ -35,8 +36,10 @@ #endif using std::pair; +using std::list; using std::ifstream; using std::string; +using std::make_pair; using boost::shared_ptr; void @@ -156,3 +159,29 @@ run_ffprobe (boost::filesystem::path content, boost::filesystem::path out, share system (ffprobe.c_str ()); #endif } + +list<pair<string, string> > +mount_info () +{ + list<pair<string, string> > m; + +#ifdef DVDOMATIC_POSIX + FILE* f = setmntent ("/etc/mtab", "r"); + if (!f) { + return m; + } + + while (1) { + struct mntent* mnt = getmntent (f); + if (!mnt) { + break; + } + + m.push_back (make_pair (mnt->mnt_dir, mnt->mnt_type)); + } + + endmntent (f); +#endif + + return m; +} |
