summaryrefslogtreecommitdiffstats
path: root/g10/tdbio.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2010-12-09 12:50:22 +0100
committerWerner Koch <wk@gnupg.org>2010-12-09 12:50:22 +0100
commit1486dec17bfb4b60f49da2ea7a342abef33f2201 (patch)
treebcec62b0deef70ab50ae5631ad9501cbe637e0f7 /g10/tdbio.c
parentChange timer tick interval under Wince (diff)
downloadgnupg2-1486dec17bfb4b60f49da2ea7a342abef33f2201.tar.xz
gnupg2-1486dec17bfb4b60f49da2ea7a342abef33f2201.zip
Change dirmngr timer under W32CE.
Fix trustdb open problem under W32CE.
Diffstat (limited to 'g10/tdbio.c')
-rw-r--r--g10/tdbio.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/g10/tdbio.c b/g10/tdbio.c
index f967742c3..73681af7d 100644
--- a/g10/tdbio.c
+++ b/g10/tdbio.c
@@ -48,6 +48,13 @@
#define MY_O_BINARY 0
#endif
+/* We use ERRNO despite that the cegcc provided open/read/write
+ functions don't set ERRNO - at least show that ERRNO does not make
+ sense. */
+#ifdef HAVE_W32CE_SYSTEM
+#undef strerror
+#define strerror(a) ("[errno not available]")
+#endif
/****************
* Yes, this is a very simple implementation. We should really
@@ -494,6 +501,13 @@ tdbio_set_dbname( const char *new_dbname, int create )
fname = xstrdup (new_dbname);
if( access( fname, R_OK ) ) {
+#ifdef HAVE_W32CE_SYSTEM
+ /* We know how the cegcc implementation of access works ;-). */
+ if (GetLastError () == ERROR_FILE_NOT_FOUND)
+ gpg_err_set_errno (ENOENT);
+ else
+ gpg_err_set_errno (EIO);
+#endif /*HAVE_W32CE_SYSTEM*/
if( errno != ENOENT ) {
log_error( _("can't access `%s': %s\n"), fname, strerror(errno) );
xfree(fname);
@@ -606,6 +620,9 @@ open_db()
#ifdef EROFS
|| errno == EROFS
#endif
+#ifdef HAVE_W32CE_SYSTEM
+ || 1 /* cegcc's open does not set ERRNO. */
+#endif
)
) {
db_fd = open (db_name, O_RDONLY | MY_O_BINARY );