[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [vidalia/master] Don't write torrc on SIGHUP if SAVECONF fails



commit ab0c63dc0833e2cd8054d344f0705f4b7f126dad
Author: Tomás Touceda <chiiph@xxxxxxxxxxxxxx>
Date:   Fri Jan 20 12:37:27 2012 -0300

    Don't write torrc on SIGHUP if SAVECONF fails
---
 src/torcontrol/TorControl.cpp |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/torcontrol/TorControl.cpp b/src/torcontrol/TorControl.cpp
index 730e821..3cf7467 100644
--- a/src/torcontrol/TorControl.cpp
+++ b/src/torcontrol/TorControl.cpp
@@ -910,7 +910,14 @@ bool
 TorControl::saveConf(QString *errmsg)
 {
   ControlCommand cmd("SAVECONF");
-  return send(cmd, errmsg);
+  bool ret = send(cmd, errmsg);
+
+  if(!ret) {
+    QString err;
+    setConf("__ReloadTorrcOnSIGHUP", "0", &err);
+  }
+
+  return ret;
 }
 
 /** Tells Tor to reset the given configuration keys back to defaults. */



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits