--- a/src/qtgui/rclmain_w.cpp
+++ b/src/qtgui/rclmain_w.cpp
@@ -15,9 +15,6 @@
  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 #include "autoconfig.h"
-
-#include <fcntl.h>
-#include "safeunistd.h"
 
 #include <utility>
 #include MEMORY_INCLUDE
@@ -138,10 +135,14 @@
 
     // idxstatus file. Make sure it exists before trying to watch it
     // (case where we're started on an older index, or if the status
-    // file was deleted since indexing
-    ::close(::open(theconfig->getIdxStatusFile().c_str(), O_CREAT, 0600));
-    m_watcher.addPath(QString::fromLocal8Bit(
-			  theconfig->getIdxStatusFile().c_str()));
+    // file was deleted since indexing)
+    QString idxfn = 
+        QString::fromLocal8Bit(theconfig->getIdxStatusFile().c_str());
+    QFile qf(idxfn);
+    qf.open(QIODevice::ReadWrite);
+    qf.setPermissions(QFile::ReadOwner|QFile::WriteOwner);
+    qf.close();
+    m_watcher.addPath(idxfn);
     // At least some versions of qt4 don't display the status bar if
     // it's not created here.
     (void)statusBar();
@@ -728,7 +729,7 @@
 	qApp->processEvents();
 	if (progress.wasCanceled()) {
 	    // Just get out of there asap. 
-	    _exit(1);
+	    exit(1);
 	}
 
 	qApp->processEvents();