diff options
author | Werner Koch <wk@gnupg.org> | 2010-03-29 14:57:11 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2010-03-29 14:57:11 +0200 |
commit | 492f08ff68bd01a28c483af31635c3d9bea4ea5d (patch) | |
tree | 49d398997bb513077e44edfd1840183e73e4ed64 /tools | |
parent | More changes for CE. gpgsm does now build and run a keylisting. (diff) | |
download | gnupg2-492f08ff68bd01a28c483af31635c3d9bea4ea5d.tar.xz gnupg2-492f08ff68bd01a28c483af31635c3d9bea4ea5d.zip |
Minor cleanups
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ChangeLog | 9 | ||||
-rw-r--r-- | tools/Makefile.am | 6 | ||||
-rw-r--r-- | tools/gpg-connect-agent.c | 2 | ||||
-rw-r--r-- | tools/gpgconf-comp.c | 44 |
4 files changed, 39 insertions, 22 deletions
diff --git a/tools/ChangeLog b/tools/ChangeLog index b9e486b2b..52a16a238 100644 --- a/tools/ChangeLog +++ b/tools/ChangeLog @@ -1,3 +1,12 @@ +2010-03-25 Werner Koch <wk@g10code.com> + + * Makefile.am (opt_libassuan_libs) [W32CE]: New. + (gpgconf_LDADD): Use it. + + * gpgconf-comp.c: Include signal.h only if available. Use + gpg_err_set_errno. + (key_matches_user_or_group) [W32CE]: Do not match any user. + 2010-03-15 Werner Koch <wk@g10code.com> * gpgconf-comp.c (my_dgettext): diff --git a/tools/Makefile.am b/tools/Makefile.am index ea066e67b..a610e6282 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -56,6 +56,10 @@ noinst_PROGRAMS = clean-sat mk-tdata make-dns-cert gpgsplit common_libs = $(libcommon) ../gl/libgnu.a pwquery_libs = ../common/libsimple-pwquery.a +if HAVE_W32CE_SYSTEM +opt_libassuan_libs = $(LIBASSUAN_LIBS) +endif + gpgsplit_LDADD = $(common_libs) \ $(LIBGCRYPT_LIBS) $(GPG_ERROR_LIBS) \ $(ZLIBS) $(LIBINTL) $(LIBICONV) @@ -64,7 +68,7 @@ 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) \ +gpgconf_LDADD = $(common_libs) $(opt_libassuan_libs) \ $(LIBINTL) $(GPG_ERROR_LIBS) $(LIBICONV) $(W32SOCKLIBS) gpgparsemail_SOURCES = gpgparsemail.c rfc822parse.c rfc822parse.h diff --git a/tools/gpg-connect-agent.c b/tools/gpg-connect-agent.c index 2bd5f8549..ae46caea8 100644 --- a/tools/gpg-connect-agent.c +++ b/tools/gpg-connect-agent.c @@ -1,5 +1,5 @@ /* gpg-connect-agent.c - Tool to connect to the agent. - * Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. + * Copyright (C) 2005, 2007, 2008, 2010 Free Software Foundation, Inc. * * This file is part of GnuPG. * diff --git a/tools/gpgconf-comp.c b/tools/gpgconf-comp.c index 866646d0d..4fe84cf27 100644 --- a/tools/gpgconf-comp.c +++ b/tools/gpgconf-comp.c @@ -1,5 +1,5 @@ /* gpgconf-comp.c - Configuration utility for GnuPG. - * Copyright (C) 2004, 2007, 2008, 2009 Free Software Foundation, Inc. + * Copyright (C) 2004, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. * * This file is part of GnuPG. * @@ -30,7 +30,9 @@ #include <errno.h> #include <time.h> #include <stdarg.h> -#include <signal.h> +#ifdef HAVE_SIGNAL_H +# include <signal.h> +#endif #include <ctype.h> #ifdef HAVE_W32_SYSTEM # define WIN32_LEAN_AND_MEAN 1 @@ -1869,7 +1871,7 @@ retrieve_options_from_program (gc_component_t component, gc_backend_t backend) if (end) *(end++) = '\0'; - errno = 0; + gpg_err_set_errno (0); flags = strtoul (linep, &tail, 0); if (errno) gc_error (1, errno, "malformed flags in option %s from %s", @@ -2185,7 +2187,7 @@ option_check_validity (gc_option_t *option, unsigned long flags, { char *tail; - errno = 0; + gpg_err_set_errno (0); *new_value_nr = strtoul (new_value, &tail, 0); if (errno) @@ -2239,7 +2241,7 @@ option_check_validity (gc_option_t *option, unsigned long flags, } else if (gc_arg_type[option->arg_type].fallback == GC_ARG_TYPE_INT32) { - errno = 0; + gpg_err_set_errno (0); (void) strtol (arg, &arg, 0); if (errno) @@ -2252,7 +2254,7 @@ option_check_validity (gc_option_t *option, unsigned long flags, } else if (gc_arg_type[option->arg_type].fallback == GC_ARG_TYPE_INT32) { - errno = 0; + gpg_err_set_errno (0); (void) strtoul (arg, &arg, 0); if (errno) @@ -2289,7 +2291,7 @@ copy_file (const char *src_name, const char *dst_name) { int saved_err = errno; fclose (src); - errno = saved_err; + gpg_err_set_errno (saved_err); return -1; } @@ -2312,7 +2314,7 @@ copy_file (const char *src_name, const char *dst_name) fclose (src); fclose (dst); unlink (dst_name); - errno = saved_errno; + gpg_err_set_errno (saved_errno); return -1; } @@ -2360,8 +2362,8 @@ change_options_file (gc_component_t component, gc_backend_t backend, /* Note that get_config_filename() calls percent_deescape(), so we call this before processing the arguments. */ dest_filename = xstrdup (get_config_filename (component, backend)); - src_filename = xasprintf ("%s.gpgconf.%i.new", dest_filename, getpid ()); - orig_filename = xasprintf ("%s.gpgconf.%i.bak", dest_filename, getpid ()); + src_filename = xasprintf ("%s.gpgconf.%i.new", dest_filename, (int)getpid ()); + orig_filename = xasprintf ("%s.gpgconf.%i.bak", dest_filename,(int)getpid ()); arg = option->new_value; if (arg && arg[0] == '\0') @@ -2412,7 +2414,7 @@ change_options_file (gc_component_t component, gc_backend_t backend, res = errno; if (!src_file) { - errno = res; + gpg_err_set_errno (res); return -1; } @@ -2599,7 +2601,7 @@ change_options_file (gc_component_t component, gc_backend_t backend, close (fd); if (dest_file) fclose (dest_file); - errno = res; + gpg_err_set_errno (res); return -1; } close (fd); @@ -2621,7 +2623,7 @@ change_options_file (gc_component_t component, gc_backend_t backend, } if (dest_file) fclose (dest_file); - errno = res; + gpg_err_set_errno (res); return -1; } @@ -2652,8 +2654,8 @@ change_options_program (gc_component_t component, gc_backend_t backend, /* FIXME. Throughout the function, do better error reporting. */ dest_filename = xstrdup (get_config_filename (component, backend)); - src_filename = xasprintf ("%s.gpgconf.%i.new", dest_filename, getpid ()); - orig_filename = xasprintf ("%s.gpgconf.%i.bak", dest_filename, getpid ()); + src_filename = xasprintf ("%s.gpgconf.%i.new", dest_filename, (int)getpid ()); + orig_filename = xasprintf ("%s.gpgconf.%i.bak", dest_filename,(int)getpid ()); #ifdef HAVE_W32_SYSTEM res = copy_file (dest_filename, orig_filename); @@ -2682,7 +2684,7 @@ change_options_program (gc_component_t component, gc_backend_t backend, res = errno; if (!src_file) { - errno = res; + gpg_err_set_errno (res); return -1; } @@ -2897,7 +2899,7 @@ change_options_program (gc_component_t component, gc_backend_t backend, close (fd); if (dest_file) fclose (dest_file); - errno = res; + gpg_err_set_errno (res); return -1; } close (fd); @@ -2919,7 +2921,7 @@ change_options_program (gc_component_t component, gc_backend_t backend, } if (dest_file) fclose (dest_file); - errno = res; + gpg_err_set_errno (res); return -1; } @@ -3017,7 +3019,7 @@ gc_component_change_options (int component, FILE *in, FILE *out) if (end) *(end++) = '\0'; - errno = 0; + gpg_err_set_errno (0); flags = strtoul (linep, &tail, 0); if (errno) gc_error (1, errno, "malformed flags in option %s", line); @@ -3087,7 +3089,7 @@ gc_component_change_options (int component, FILE *in, FILE *out) gc_error (0, 0, _("External verification of component %s failed"), gc_component[component].name); - errno = EINVAL; + gpg_err_set_errno (EINVAL); } } @@ -3236,6 +3238,7 @@ key_matches_user_or_group (char *user) /* Under Windows we don't support groups. */ if (group && *group) gc_error (0, 0, _("Note that group specifications are ignored\n")); +#ifndef HAVE_W32CE_SYSTEM if (*user) { static char *my_name; @@ -3255,6 +3258,7 @@ key_matches_user_or_group (char *user) if (!strcmp (user, my_name)) return 1; /* Found. */ } +#endif /*HAVE_W32CE_SYSTEM*/ #else /*!HAVE_W32_SYSTEM*/ /* First check whether the user matches. */ if (*user) |