[PC-BSD Commits] r19597 - pcbsd/current/src-qt4/pc-mounttray

svn at pcbsd.org svn at pcbsd.org
Thu Oct 4 06:42:38 PDT 2012


Author: kenmoore
Date: 2012-10-04 13:42:37 +0000 (Thu, 04 Oct 2012)
New Revision: 19597

Modified:
   pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp
Log:
Commit a fix for mounting a device onto a currently empty (but existing) mountpoint



Modified: pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp	2012-10-04 12:37:22 UTC (rev 19596)
+++ pcbsd/current/src-qt4/pc-mounttray/mountTray.cpp	2012-10-04 13:42:37 UTC (rev 19597)
@@ -320,7 +320,14 @@
     //QMessageBox::warning(this,tr("Unknown Device Filesystem"),tr("The filesystem on this device is unknown and cannot be mounted at this time") );
     //return FALSE;
   }
-  
+  //Make sure the mntpoint is available
+  QDir mpd(mntpoint);
+  if(mpd.exists()){
+    //Remove the existing directory (will work only if it is empty)
+    mpd.cdUp();
+    mpd.rmdir(mntpoint);
+  }
+  //Prepare the commands to run
   QString cmd1 = "mkdir " + mntpoint;
   QString cmd2 = fstype + " " +fsopts + " " + dev + " " + mntpoint;
   



More information about the Commits mailing list