diff options
author | Werner Koch <[email protected]> | 2010-08-23 19:26:05 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2010-08-23 19:26:05 +0000 |
commit | d9791119d0967717e7690e85a69bac830ddf65f4 (patch) | |
tree | ad09c31d1d2842e6c5f47e27d28c812b391383cb /tools | |
parent | Reworked the posix and w32 exechelpers. (diff) | |
download | gnupg-d9791119d0967717e7690e85a69bac830ddf65f4.tar.gz gnupg-d9791119d0967717e7690e85a69bac830ddf65f4.zip |
gpgconf does now work for Wince.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ChangeLog | 14 | ||||
-rw-r--r-- | tools/Makefile.am | 12 | ||||
-rw-r--r-- | tools/gpgconf-comp.c | 21 |
3 files changed, 35 insertions, 12 deletions
diff --git a/tools/ChangeLog b/tools/ChangeLog index 8e2f9413f..b400f02a5 100644 --- a/tools/ChangeLog +++ b/tools/ChangeLog @@ -1,3 +1,17 @@ +2010-08-23 Werner Koch <[email protected]> + + * gpgconf-comp.c (GPGNAME) [W32CE]: s/gpg2/gpg/. + (get_config_filename) [W32CE]: Adjust absolute file name check. + + * gpgconf-comp.c (retrieve_options_from_program) + (retrieve_options_from_file, retrieve_options_from_program) + (copy_file, gc_process_gpgconf_conf): Do not use es_ferror after a + failed es_fclose. Note that the stream is in any case invalid + after calling es_fclose and that es_fclose does set ERRNO. + + * Makefile.am (maybe_commonpth_libs): New. + (gpgconf_LDADD): Use it. + 2010-08-20 Werner Koch <[email protected]> * gpgconf-comp.c (collect_error_output): Remove extra CRs. diff --git a/tools/Makefile.am b/tools/Makefile.am index 5294b8ce6..b85d2640b 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -67,6 +67,14 @@ endif common_libs = $(libcommon) ../gl/libgnu.a commonpth_libs = $(libcommonpth) ../gl/libgnu.a + +# Some modules require PTH under W32CE. +if HAVE_W32CE_SYSTEM +maybe_commonpth_libs = $(commonpth_libs) +else +maybe_commonpth_libs = $(common_libs) +endif + if HAVE_W32CE_SYSTEM pwquery_libs = else @@ -85,8 +93,8 @@ gpgconf_SOURCES = gpgconf.c gpgconf.h gpgconf-comp.c no-libgcrypt.c # common sucks in gpg-error, will they, nil they (some compilers # do not eliminate the supposed-to-be-unused-inline-functions). -gpgconf_LDADD = $(common_libs) $(opt_libassuan_libs) \ - $(LIBINTL) $(GPG_ERROR_LIBS) $(NETLIBS) \ +gpgconf_LDADD = $(maybe_commonpth_libs) $(opt_libassuan_libs) \ + $(LIBINTL) $(GPG_ERROR_LIBS) $(PTH_LIBS) $(NETLIBS) \ $(LIBICONV) $(W32SOCKLIBS) gpgparsemail_SOURCES = gpgparsemail.c rfc822parse.c rfc822parse.h 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); |