wrowe 02/02/11 17:32:55
Modified: file_io/win32 open.c
Log:
stdfoo handles are unsupported on WinCE. Submitted by Mladen Turk
<[EMAIL PROTECTED]>.
I believe the patch for CE is wrong is one respect, IIRC we should fall
over from MoveFile to CopyFile if the file device varied. Confirmation?
Revision Changes Path
1.94 +20 -0 apr/file_io/win32/open.c
Index: open.c
===================================================================
RCS file: /home/cvs/apr/file_io/win32/open.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -r1.93 -r1.94
--- open.c 12 Feb 2002 00:07:34 -0000 1.93
+++ open.c 12 Feb 2002 01:32:55 -0000 1.94
@@ -59,10 +59,14 @@
#include "apr_strings.h"
#include "apr_portable.h"
#include "apr_thread_mutex.h"
+#if APR_HAVE_ERRNO_H
#include <errno.h>
+#endif
#include <winbase.h>
#include <string.h>
+#if APR_HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
#include "misc.h"
#if APR_HAS_UNICODE_FS
@@ -466,8 +470,12 @@
/ sizeof(apr_wchar_t), topath))
{
return rv;
}
+#ifndef _WIN32_WCE
if (MoveFileExW(wfrompath, wtopath, MOVEFILE_REPLACE_EXISTING |
MOVEFILE_COPY_ALLOWED))
+#else
+ if (MoveFileW(wfrompath, wtopath))
+#endif
return APR_SUCCESS;
#else
if (MoveFileEx(frompath, topath, MOVEFILE_REPLACE_EXISTING |
@@ -530,6 +538,9 @@
APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile,
apr_pool_t *cont)
{
+#ifdef _WIN32_WCE
+ return APR_ENOTIMPL;
+#else
apr_os_file_t file_handle;
file_handle = GetStdHandle(STD_ERROR_HANDLE);
@@ -537,10 +548,14 @@
return APR_EINVAL;
return apr_os_file_put(thefile, &file_handle, 0, cont);
+#endif
}
APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile,
apr_pool_t *cont)
{
+#ifdef _WIN32_WCE
+ return APR_ENOTIMPL;
+#else
apr_os_file_t file_handle;
file_handle = GetStdHandle(STD_OUTPUT_HANDLE);
@@ -548,10 +563,14 @@
return APR_EINVAL;
return apr_os_file_put(thefile, &file_handle, 0, cont);
+#endif
}
APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile,
apr_pool_t *cont)
{
+#ifdef _WIN32_WCE
+ return APR_ENOTIMPL;
+#else
apr_os_file_t file_handle;
file_handle = GetStdHandle(STD_INPUT_HANDLE);
@@ -559,6 +578,7 @@
return APR_EINVAL;
return apr_os_file_put(thefile, &file_handle, 0, cont);
+#endif
}
APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt);