summaryrefslogtreecommitdiffstats
path: root/tools/gpgconf-comp.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2010-08-23 21:26:05 +0200
committerWerner Koch <wk@gnupg.org>2010-08-23 21:26:05 +0200
commitd9791119d0967717e7690e85a69bac830ddf65f4 (patch)
treead09c31d1d2842e6c5f47e27d28c812b391383cb /tools/gpgconf-comp.c
parentReworked the posix and w32 exechelpers. (diff)
downloadgnupg2-d9791119d0967717e7690e85a69bac830ddf65f4.tar.xz
gnupg2-d9791119d0967717e7690e85a69bac830ddf65f4.zip
gpgconf does now work for Wince.
Diffstat (limited to 'tools/gpgconf-comp.c')
-rw-r--r--tools/gpgconf-comp.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c
index 9ee3ce4d3..1718a08a5 100644
--- a/tools/gpgconf-comp.c
+++ b/tools/gpgconf-comp.c
@@ -54,9 +54,8 @@
/* There is a problem with gpg 1.4 under Windows: --gpgconf-list
returns a plain filename without escaping. As long as we have not
- fixed that we need to use gpg2 - it might actually be better to use
- gpg2 in any case. */
-#ifdef HAVE_W32_SYSTEM
+ fixed that we need to use gpg2. */
+#if defined(HAVE_W32_SYSTEM) && !defined(HAVE_W32CE_SYSTEM)
#define GPGNAME "gpg2"
#else
#define GPGNAME "gpg"
@@ -1799,7 +1798,9 @@ get_config_filename (gc_component_t component, gc_backend_t backend)
else
filename = "";
-#ifdef HAVE_DOSISH_SYSTEM
+#if HAVE_W32CE_SYSTEM
+ if (!(filename[0] == '/' || filename[0] == '\\'))
+#elif defined(HAVE_DOSISH_SYSTEM)
if (!(filename[0]
&& filename[1] == ':'
&& (filename[2] == '/' || filename[2] == '\\')))
@@ -1916,7 +1917,7 @@ retrieve_options_from_program (gc_component_t component, gc_backend_t backend)
}
if (length < 0 || es_ferror (outfp))
gc_error (1, errno, "error reading from %s", pgmname);
- if (es_fclose (outfp) && es_ferror (outfp))
+ if (es_fclose (outfp))
gc_error (1, errno, "error closing %s", pgmname);
err = gnupg_wait_process (pgmname, pid, 1, &exitcode);
@@ -2018,7 +2019,7 @@ retrieve_options_from_program (gc_component_t component, gc_backend_t backend)
if (length < 0 || es_ferror (config))
gc_error (1, errno, "error reading from %s", config_filename);
- if (es_fclose (config) && es_ferror (config))
+ if (es_fclose (config))
gc_error (1, errno, "error closing %s", config_filename);
}
@@ -2098,7 +2099,7 @@ retrieve_options_from_file (gc_component_t component, gc_backend_t backend)
if (config_option->flags & GC_OPT_FLAG_NO_CHANGE)
list_option->flags |= GC_OPT_FLAG_NO_CHANGE;
- if (list_file && fclose (list_file) && ferror (list_file))
+ if (list_file && fclose (list_file))
gc_error (1, errno, "error closing %s", list_filename);
xfree (line);
}
@@ -2328,9 +2329,9 @@ copy_file (const char *src_name, const char *dst_name)
return -1;
}
- if (fclose (dst) && ferror (dst))
+ if (fclose (dst))
gc_error (1, errno, "error closing %s", dst_name);
- if (fclose (src) && ferror (src))
+ if (fclose (src))
gc_error (1, errno, "error closing %s", src_name);
return 0;
@@ -3623,7 +3624,7 @@ gc_process_gpgconf_conf (const char *fname_arg, int update, int defaults,
gc_error (0, errno, "error reading from `%s'", fname);
result = -1;
}
- if (fclose (config) && ferror (config))
+ if (fclose (config))
gc_error (0, errno, "error closing `%s'", fname);
xfree (line);