Revision: 4253
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=4253&view=rev
Author:   atkac
Date:     2011-02-07 10:45:50 +0000 (Mon, 07 Feb 2011)

Log Message:
-----------
[Bugfix] win vncviewer: create VNC home directory during startup.

Thanks to Guillaume Destuynder.

Modified Paths:
--------------
    trunk/win/vncviewer/vncviewer.cxx

Modified: trunk/win/vncviewer/vncviewer.cxx
===================================================================
--- trunk/win/vncviewer/vncviewer.cxx   2011-02-07 10:45:15 UTC (rev 4252)
+++ trunk/win/vncviewer/vncviewer.cxx   2011-02-07 10:45:50 UTC (rev 4253)
@@ -31,6 +31,7 @@
 #include <vncviewer/OptionsDialog.h>
 #include <vncviewer/ListenTrayIcon.h>
 #include <network/TcpSocket.h>
+#include <os/os.h>
 #include <rfb/Logger_stdio.h>
 #include <rfb/Logger_file.h>
 #include <rfb/LogWriter.h>
@@ -220,6 +221,17 @@
 
     programInfo();
 
+    // Create vnc in the user's home directory if it doesn't already exist
+    char* homeDir = NULL;
+    if (getvnchomedir(&homeDir) == -1)
+      vlog.error("Could not create vnc directory: can't obtain home directory 
path");
+    else {
+      int result = CreateDirectory(homeDir, NULL);
+      if (result <= 0 && GetLastError() != ERROR_ALREADY_EXISTS)
+        vlog.error("Could not create vnc directory: %u", GetLastError());
+      delete [] homeDir;
+    }
+
     // - Connect to the clients
     if (!configFiles.empty() || !hosts.empty() || acceptIncoming) {
       // - Configure the registry configuration reader


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
Tigervnc-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to