[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[vidalia-svn] r1218: Make sure the full path exists to our torrc when we touch it (trunk/src/control)
Author: edmanm
Date: 2006-09-21 01:34:38 -0400 (Thu, 21 Sep 2006)
New Revision: 1218
Modified:
trunk/src/control/torcontrol.cpp
Log:
Make sure the full path exists to our torrc when we touch it.
Modified: trunk/src/control/torcontrol.cpp
===================================================================
--- trunk/src/control/torcontrol.cpp 2006-09-21 05:34:08 UTC (rev 1217)
+++ trunk/src/control/torcontrol.cpp 2006-09-21 05:34:38 UTC (rev 1218)
@@ -27,6 +27,7 @@
#include <QHostAddress>
#include <config/torsettings.h>
#include <util/net.h>
+#include <util/file.h>
#include "torcontrol.h"
@@ -78,13 +79,10 @@
} else {
TorSettings settings;
- /* Make sure our torrc exists. If it doesn't, touch it. */
- if (!QFile::exists(settings.getTorrc())) {
- QFile torrc(settings.getTorrc());
- torrc.open(QIODevice::WriteOnly);
- torrc.close();
- }
-
+ /* Make sure our torrc and the full path to it exists. If it doesn't,
+ * then touch it. */
+ touch_file(settings.getTorrc(), true);
+
if (TorService::isSupported() && settings.getUseService()) {
_torService = new TorService(settings.getExecutable(),
settings.getTorrc(), this);