# HG changeset patch # User Daniel Atallah # Date 1165197125 0 # Node ID 59189ce09f1097c1fbf185da317d89c863e87d0c # Parent 77a45b20f57fbc1477ca6526c563466997879418 [gaim-migrate @ 17885] Fix wingaim file receiving. It turns out that _access() on win32 is really horrible and will fail on directories when checking any other mode than F_OK. committer: Tailor Script diff -r 77a45b20f57f -r 59189ce09f10 libgaim/ft.c --- a/libgaim/ft.c Sun Dec 03 21:49:17 2006 +0000 +++ b/libgaim/ft.c Mon Dec 04 01:52:05 2006 +0000 @@ -219,9 +219,14 @@ if (g_stat(filename, &st) != 0) { /* File not found. */ if (gaim_xfer_get_type(xfer) == GAIM_XFER_RECEIVE) { +#ifndef _WIN32 + int mode = W_OK; +#else + int mode = F_OK; +#endif dir = g_path_get_dirname(filename); - if (g_access(dir, W_OK) == 0) { + if (g_access(dir, mode) == 0) { gaim_xfer_request_accepted(xfer, filename); } else { gaim_xfer_ref(xfer); diff -r 77a45b20f57f -r 59189ce09f10 libgaim/internal.h --- a/libgaim/internal.h Sun Dec 03 21:49:17 2006 +0000 +++ b/libgaim/internal.h Mon Dec 04 01:52:05 2006 +0000 @@ -142,7 +142,7 @@ # define g_open open #endif -#if !GLIB_CHECK_VERSION(2,8,0) +#if !GLIB_CHECK_VERSION(2,8,0) && !defined _WIN32 # define g_access access #endif diff -r 77a45b20f57f -r 59189ce09f10 libgaim/win32/libc_interface.h --- a/libgaim/win32/libc_interface.h Sun Dec 03 21:49:17 2006 +0000 +++ b/libgaim/win32/libc_interface.h Mon Dec 04 01:52:05 2006 +0000 @@ -123,7 +123,6 @@ #if !GLIB_CHECK_VERSION(2,8,0) int wgaim_g_access(const gchar *filename, int mode); -#undef g_access #define g_access( filename, mode) \ wgaim_g_access( filename, mode ) #endif