From 94c45b7ff336b41fe67df2c7b8240f70ffe6352e Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 28 Dec 2000 15:49:42 +0000 Subject: [PATCH] Remove lockfiles and other changes --- THANKS | 1 + VERSION | 2 +- cipher/dynload.c | 19 +++++++++++++++++++ g10/ChangeLog | 6 ++++++ g10/signal.c | 3 +++ include/util.h | 2 +- util/ChangeLog | 5 +++++ util/dotlock.c | 5 ++--- 8 files changed, 38 insertions(+), 5 deletions(-) diff --git a/THANKS b/THANKS index 71aa72e75..510168239 100644 --- a/THANKS +++ b/THANKS @@ -114,6 +114,7 @@ Oskari J Paul D. Smith psmith@baynetworks.com Per Cederqvist ceder@lysator.liu.se Philippe Laliberte arsphl@oeil.qc.ca +Peter Fales psfales@lucent.com Peter Gutmann pgut001@cs.auckland.ac.nz Peter Marschall Peter.Marschall@gedos.de QingLong qinglong@bolizm.ihep.su diff --git a/VERSION b/VERSION index a71955659..a0bbf9ac4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.4c +1.0.4d diff --git a/cipher/dynload.c b/cipher/dynload.c index e2c988e02..adf576780 100644 --- a/cipher/dynload.c +++ b/cipher/dynload.c @@ -67,6 +67,25 @@ dlsym(void *handle, char *name) } #endif /*HAVE_DL_SHL_LOAD*/ +#ifdef __MINGW32__ +#warning Needs some more work. Based on Disastry@saiknes.lv patch. + +#define dlopen(PATHNAME,MODE) ((void *)LoadLibrary(PATHNAME)) +#define dlclose(HANDLE) FreeLibrary(HANDLE) +char *dlerror(void) +{ + static char dlerrstr[10]; + int err=GetLastError(); + if (!err) + return NULL; + sprintf(dlerrstr, "%u", err); + return dlerrstr; +} +#define dlsym(HANDLE,NAME) GetProcAddress(HANDLE,NAME) +#endif /*__MINGW32__*/ + + + typedef struct ext_list { diff --git a/g10/ChangeLog b/g10/ChangeLog index c3561d9f5..252467dda 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,9 @@ +2000-12-28 Werner Koch + + * signal.c (got_fatal_signal): Remove lockfiles here because the + atexit stuff does not work due to the use of raise. Suggested by + Peter Fales. + 2000-12-19 Werner Koch * status.c, status.h (cpr_get_no_help): New. diff --git a/g10/signal.c b/g10/signal.c index cf8dbd5eb..7b34bd8d1 100644 --- a/g10/signal.c +++ b/g10/signal.c @@ -75,6 +75,9 @@ got_fatal_signal( int sig ) sigaction( sig, &nact, NULL); } #endif + + remove_lockfiles (); + raise( sig ); } diff --git a/include/util.h b/include/util.h index 4c475927c..9d2d1a75c 100644 --- a/include/util.h +++ b/include/util.h @@ -136,7 +136,7 @@ void disable_dotlock(void); DOTLOCK create_dotlock( const char *file_to_lock ); int make_dotlock( DOTLOCK h, long timeout ); int release_dotlock( DOTLOCK h ); - +void remove_lockfiles (void); /*-- fileutil.c --*/ char * make_basename(const char *filepath); diff --git a/util/ChangeLog b/util/ChangeLog index 2f5609d84..fd1279ef9 100644 --- a/util/ChangeLog +++ b/util/ChangeLog @@ -1,3 +1,8 @@ +2000-12-28 Werner Koch + + * dotlock.c: Made all_lockfiles volatile. + (remove_lockfiles): Made public. + 2000-11-30 Werner Koch * iobuf.c (iobuf_translate_file_handle): New. diff --git a/util/dotlock.c b/util/dotlock.c index fc8ddae36..a56789608 100644 --- a/util/dotlock.c +++ b/util/dotlock.c @@ -46,11 +46,10 @@ struct dotlock_handle { }; -static DOTLOCK all_lockfiles; +static volatile DOTLOCK all_lockfiles; static int never_lock; static int read_lockfile( const char *name ); -static void remove_lockfiles(void); void disable_dotlock(void) @@ -349,7 +348,7 @@ read_lockfile( const char *name ) } -static void +void remove_lockfiles() { #ifndef HAVE_DOSISH_SYSTEM