]> source.dussan.org Git - tigervnc.git/commitdiff
[Bugfix] Don't include unistd.h and don't call access() on Windows.
authorAdam Tkac <atkac@redhat.com>
Wed, 19 Jan 2011 14:11:16 +0000 (14:11 +0000)
committerAdam Tkac <atkac@redhat.com>
Wed, 19 Jan 2011 14:11:16 +0000 (14:11 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4239 3789f03b-4d11-0410-bbf8-ca57d06f2519

common/rfb/CSecurityTLS.cxx

index 7e694d1bf7bb4eeb3aebe795e62c846b204abe69..446674f481fd07ba04d44368f38b95da056553c2 100644 (file)
@@ -29,7 +29,9 @@
 #endif
 
 #include <stdlib.h>
+#ifndef WIN32
 #include <unistd.h>
+#endif
 
 #include <rfb/CSecurityTLS.h>
 #include <rfb/SSecurityVeNCrypt.h> 
@@ -95,11 +97,16 @@ void CSecurityTLS::setDefaults()
   sprintf(caDefault.buf, "%s/.vnc/x509_certs", homeDir);
   delete [] homeDir;
 
+#ifndef WIN32
   /* XXX Do we need access() check here? */
   if (!access(caDefault.buf, R_OK))
     x509ca.setDefaultStr(strdup(caDefault.buf));
   else
     vlog.error("Failed to open ~/.vnc/x509_certs");
+#else
+  /* Windows doesn't have access() function. */
+  x509ca.setDefaultStr(strdup(caDefault.buf));
+#endif
 }
 
 void CSecurityTLS::shutdown()