From 772fd84afcc9fc2e4999662b872d1b83f03b0b72 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Tue, 9 Oct 2007 12:22:37 +0000 Subject: [PATCH] Fix compile errors on Windows svn path=/trunk/boinc/; revision=13807 --- client/sandbox.C | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/sandbox.C b/client/sandbox.C index 457b1630ca..948d5417fc 100644 --- a/client/sandbox.C +++ b/client/sandbox.C @@ -17,10 +17,13 @@ // or write to the Free Software Foundation, Inc., // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +#ifndef _WIN32 #include #include #include #include +#endif #include "error_numbers.h" #include "file_names.h" @@ -33,7 +36,8 @@ bool g_use_sandbox = false; -#if (!defined(_WIN32) && !defined(_DEBUG)) +#ifndef _WIN32 +#ifndef _DEBUG static int lookup_group(char* name, gid_t& gid) { struct group* gp = getgrnam(name); if (!gp) return ERR_GETGRNAM; @@ -119,6 +123,8 @@ int remove_project_owned_file_or_dir(const char* path) { return ERR_UNLINK; } +#endif // ! _WIN32 + static int delete_project_owned_file_aux(const char* path) { #ifdef _WIN32 if (DeleteFile(path)) return 0; @@ -168,10 +174,12 @@ int clean_out_dir(const char* dirpath) { dirp = dir_open(dirpath); if (!dirp) { +#ifndef _WIN32 if (g_use_sandbox && (errno == EACCES)) { // dir may be owned by boinc_apps return remove_project_owned_file_or_dir(dirpath); } +#endif return 0; // if dir doesn't exist, it's empty }