From: Carl Hetherington Date: Mon, 24 Jun 2013 15:02:52 +0000 (+0100) Subject: Add logging of mount formats in Linux. X-Git-Tag: v2.0.48~1337^2~302^2~23^2~10 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=362068b534ffefcb87debd4d56b56645f3e25f21 Add logging of mount formats in Linux. --- 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 +#include #endif #ifdef DVDOMATIC_WINDOWS #include @@ -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 > +mount_info () +{ + list > 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; +} diff --git a/src/lib/cross.h b/src/lib/cross.h index 1a7a8cb4d..d9cc2d12f 100644 --- a/src/lib/cross.h +++ b/src/lib/cross.h @@ -26,6 +26,7 @@ class Log; #define WEXITSTATUS(w) (w) #endif -void dvdomatic_sleep (int); +extern void dvdomatic_sleep (int); extern std::pair cpu_info (); extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path, boost::shared_ptr); +extern std::list > mount_info (); diff --git a/src/lib/film.cc b/src/lib/film.cc index 3d9b3eeb4..c4dc9d830 100644 --- a/src/lib/film.cc +++ b/src/lib/film.cc @@ -68,6 +68,7 @@ using std::setfill; using std::min; using std::make_pair; using std::endl; +using std::list; using boost::shared_ptr; using boost::lexical_cast; using boost::to_upper_copy; @@ -329,6 +330,10 @@ Film::make_dcp () #endif pair const c = cpu_info (); log()->log (String::compose ("CPU: %1, %2 processors", c.first, c.second)); + list > const m = mount_info (); + for (list >::const_iterator i = m.begin(); i != m.end(); ++i) { + log()->log (String::compose ("Mount: %1 %2", i->first, i->second)); + } if (format() == 0) { throw MissingSettingError (_("format"));