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

[vidalia-svn] r1878: Since we currently can't get a list of running processes on (in trunk: . src)



Author: edmanm
Date: 2007-08-25 23:23:17 -0400 (Sat, 25 Aug 2007)
New Revision: 1878

Modified:
   trunk/
   trunk/src/main.cpp
Log:
 r2077@adrastea:  edmanm | 2007-08-25 23:23:10 -0400
 Since we currently can't get a list of running processes on Windows NT, be
 pessimistic and assume the existence of a nonzero pidfile means Vidalia is
 already running. If this turns out to produce too many false positives, the
 three people running Windows NT can yell at me.



Property changes on: trunk
___________________________________________________________________
 svk:merge ticket from /vidalia/local/trunk [r2077] on 54b3572a-7227-0410-958f-53ecd705b71a

Modified: trunk/src/main.cpp
===================================================================
--- trunk/src/main.cpp	2007-08-26 03:09:22 UTC (rev 1877)
+++ trunk/src/main.cpp	2007-08-26 03:23:17 UTC (rev 1878)
@@ -32,6 +32,9 @@
 #include <util/process.h>
 #include <util/string.h>
 
+#if defined(Q_OS_WIN32)
+#include <QSysInfo>
+#endif
 
 /** Returns true if there is already another Vidalia process running. */
 bool
@@ -40,7 +43,17 @@
   /* Read the pidfile and find out if that process still exists */
   qint64 pid = read_pidfile(pidfile);
   if (pid > 0) {
+#if defined(Q_OS_WIN32)
+    if (QSysInfo::WindowsVersion == QSysInfo::WV_NT) {
+      /* We currently can't get a list of running processes on Windows NT, so
+       * be pessimistic and assume the existence of a nonzero pidfile means
+       * Vidalia is running. */
+      return true;
+    } else
+      return (is_process_running(pid));
+#else
     return (is_process_running(pid));
+#endif
   }
   return false;
 }