Mercurial > pidgin.yaz
changeset 15100:59189ce09f10
[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 <tailor@pidgin.im>
author | Daniel Atallah <daniel.atallah@gmail.com> |
---|---|
date | Mon, 04 Dec 2006 01:52:05 +0000 |
parents | 77a45b20f57f |
children | ded621e635e4 |
files | libgaim/ft.c libgaim/internal.h libgaim/win32/libc_interface.h |
diffstat | 3 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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);
--- 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
--- 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