diff options
author | Werner Koch <wk@gnupg.org> | 2010-03-02 22:25:08 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2010-03-02 22:25:08 +0100 |
commit | d232fd2e543fb81151d7fe25e9f0692610870788 (patch) | |
tree | 8ce5ef17c07737c2ae873f945f99fb255f6573a3 /common/iobuf.c | |
parent | Finished jnlib port to CE. (diff) | |
download | gnupg2-d232fd2e543fb81151d7fe25e9f0692610870788.tar.xz gnupg2-d232fd2e543fb81151d7fe25e9f0692610870788.zip |
First steps towards the W32CE port
Diffstat (limited to 'common/iobuf.c')
-rw-r--r-- | common/iobuf.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/common/iobuf.c b/common/iobuf.c index 0d2a5a5ba..356e9cdc3 100644 --- a/common/iobuf.c +++ b/common/iobuf.c @@ -306,7 +306,21 @@ direct_open (const char *fname, const char *mode) sm = FILE_SHARE_READ; } +#ifdef HAVE_W32CE_SYSTEM + { + wchar_t *wfname = utf8_to_wchar (fname); + if (wfname) + { + hfile = CreateFile (wfname, da, sm, NULL, cd, + FILE_ATTRIBUTE_NORMAL, NULL); + xfree (wfname); + } + else + hfile = INVALID_HANDLE_VALUE; + } +#else hfile = CreateFile (fname, da, sm, NULL, cd, FILE_ATTRIBUTE_NORMAL, NULL); +#endif return hfile; #else /*!HAVE_W32_SYSTEM*/ int oflag; @@ -1188,7 +1202,14 @@ iobuf_cancel (iobuf_t a) { /* Argg, MSDOS does not allow to remove open files. So * we have to do it here */ +#ifdef HAVE_W32CE_SYSTEM + wchar_t *wtmp = utf8_to_wchar (remove_name); + if (wtmp) + DeleteFile (wtmp); + xfree (wtmp); +#else remove (remove_name); +#endif xfree (remove_name); } #endif |