summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-06-24 16:02:52 +0100
committerCarl Hetherington <cth@carlh.net>2013-06-24 16:02:52 +0100
commit362068b534ffefcb87debd4d56b56645f3e25f21 (patch)
tree24310294873832de56272632d490afe63876dc4e /src/lib
parentf1f25e57c97a6ea28513820912169305795c7d14 (diff)
Add logging of mount formats in Linux.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cross.cc29
-rw-r--r--src/lib/cross.h3
-rw-r--r--src/lib/film.cc5
3 files changed, 36 insertions, 1 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;
+}
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<std::string, int> cpu_info ();
extern void run_ffprobe (boost::filesystem::path, boost::filesystem::path, boost::shared_ptr<Log>);
+extern std::list<std::pair<std::string, std::string> > 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<string, int> const c = cpu_info ();
log()->log (String::compose ("CPU: %1, %2 processors", c.first, c.second));
+ list<pair<string, string> > const m = mount_info ();
+ for (list<pair<string, string> >::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"));