mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-31 11:41:32 +01:00
Minor cleanups
This commit is contained in:
parent
f080b353ed
commit
492f08ff68
@ -1,3 +1,12 @@
|
||||
2010-03-29 Werner Koch <wk@g10code.com>
|
||||
|
||||
* init.c (sleep_on_exit): Change to 400ms.
|
||||
|
||||
2010-03-25 Werner Koch <wk@g10code.com>
|
||||
|
||||
* init.c (sleep_on_exit) [W32CE]: New.
|
||||
(init_common_subsystems): Call it.
|
||||
|
||||
2010-03-24 Werner Koch <wk@g10code.com>
|
||||
|
||||
* stringhelp.c (change_slashes, compare_filenames): Replace
|
||||
|
@ -36,6 +36,13 @@
|
||||
#ifdef HAVE_W32CE_SYSTEM
|
||||
#include <assuan.h>
|
||||
static void parse_std_file_handles (int *argcp, char ***argvp);
|
||||
static void
|
||||
sleep_on_exit (void)
|
||||
{
|
||||
/* The sshd on CE swallows some of the command output. Sleeping a
|
||||
while usually helps. */
|
||||
Sleep (400);
|
||||
}
|
||||
#endif /*HAVE_W32CE_SYSTEM*/
|
||||
|
||||
|
||||
@ -77,6 +84,7 @@ init_common_subsystems (int *argcp, char ***argvp)
|
||||
/* Special hack for Windows CE: We extract some options from arg
|
||||
to setup the standard handles. */
|
||||
#ifdef HAVE_W32CE_SYSTEM
|
||||
atexit (sleep_on_exit);
|
||||
parse_std_file_handles (argcp, argvp);
|
||||
#else
|
||||
(void)argcp;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2010-03-26 Werner Koch <wk@g10code.com>
|
||||
|
||||
* signal.c (pause_on_sigusr): Remove. It was used in ancient gpg
|
||||
version with shared memory IPC. Last caller removed on 2006-04-18.
|
||||
|
||||
2010-03-24 Werner Koch <wk@g10code.com>
|
||||
|
||||
* openfile.c (CMP_FILENAME): Depend on HAVE_DOSISH_SYSTEM instead
|
||||
|
@ -331,7 +331,6 @@ PKT_plaintext *setup_plaintext_name(const char *filename,IOBUF iobuf);
|
||||
|
||||
/*-- signal.c --*/
|
||||
void init_signals(void);
|
||||
void pause_on_sigusr( int which );
|
||||
void block_all_signals(void);
|
||||
void unblock_all_signals(void);
|
||||
|
||||
|
26
g10/signal.c
26
g10/signal.c
@ -36,7 +36,6 @@
|
||||
|
||||
#ifdef HAVE_DOSISH_SYSTEM
|
||||
void init_signals(void) {}
|
||||
void pause_on_sigusr(int which) {}
|
||||
#else
|
||||
static volatile int caught_fatal_sig = 0;
|
||||
static volatile int caught_sigusr1 = 0;
|
||||
@ -133,31 +132,6 @@ init_signals()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
pause_on_sigusr( int which )
|
||||
{
|
||||
#if defined(HAVE_SIGPROCMASK) && defined(HAVE_SIGSET_T)
|
||||
sigset_t mask, oldmask;
|
||||
|
||||
assert( which == 1 );
|
||||
sigemptyset( &mask );
|
||||
sigaddset( &mask, SIGUSR1 );
|
||||
|
||||
sigprocmask( SIG_BLOCK, &mask, &oldmask );
|
||||
while( !caught_sigusr1 )
|
||||
sigsuspend( &oldmask );
|
||||
caught_sigusr1 = 0;
|
||||
sigprocmask( SIG_UNBLOCK, &mask, NULL );
|
||||
#else
|
||||
assert (which == 1);
|
||||
sighold (SIGUSR1);
|
||||
while (!caught_sigusr1)
|
||||
sigpause(SIGUSR1);
|
||||
caught_sigusr1 = 0;
|
||||
sigrelse(SIGUSR1);
|
||||
#endif /*! HAVE_SIGPROCMASK && HAVE_SIGSET_T */
|
||||
}
|
||||
|
||||
/* Disabled - see comment in tdbio.c:tdbio_begin_transaction() */
|
||||
#if 0
|
||||
static void
|
||||
|
@ -1969,7 +1969,6 @@ static void
|
||||
emergency_cleanup (void)
|
||||
{
|
||||
gcry_control (GCRYCTL_TERM_SECMEM );
|
||||
gnupg_sleep (2);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user