Gnus development mailing list
 help / color / mirror / Atom feed
From: Andreas Jaeger <aj@suse.de>
Subject: Problem with timer in gpg.el
Date: Tue, 07 Aug 2001 16:39:34 +0200	[thread overview]
Message-ID: <ho3d749bo9.fsf@gee.suse.de> (raw)

[-- Attachment #1: Type: text/plain, Size: 1747 bytes --]


I've got a problem with timers in gpg.el in XEmacs.

I regularly get the message:
itimer named "itimer-0" already existing and activated

The problem is that the value of gpg-passpthrase-timer is cached, the
implementation in XEmacs seems to require that a canceled timer is not used
anymore.  The next time a new timer is used, in my case by perl, it
reuses the name "itimer-0", and then gpg get's a problem...

I'm appending a patch that solved the problem for me,
Andreas

2001-08-07  Andreas Jaeger  <aj@suse.de>

	* gpg.el (gpg-passphrase-forget): Don't cache
	gpg-passphrase-timer.
	(gpg-passphrase-store): Check if gpg-passphrase-timer is
	initialized already.
 
Index: gpg.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/contrib/gpg.el,v
retrieving revision 1.14
diff -u -p -r1.14 gpg.el
--- gpg.el	2001/07/30 23:04:20	1.14
+++ gpg.el	2001/08/07 12:44:03
@@ -801,6 +801,7 @@ evaluates BODY, like `progn'.  If BODY e
   "Forget stored passphrase."
   (interactive)
   (cancel-timer gpg-passphrase-timer)
+  (setq gpg-passphrase-timer nil)
   (gpg-passphrase-clear-string gpg-passphrase)
   (setq gpg-passphrase nil))
 
@@ -808,6 +809,8 @@ evaluates BODY, like `progn'.  If BODY e
   "Store PASSPHRASE in cache.
 Updates the timeout for clearing the cache to `gpg-passphrase-timeout'."
   (unless (equal gpg-passphrase-timeout 0)
+    (if (null gpg-passphrase-timer)
+	(setq gpg-passphrase-timer (timer-create)))
     (timer-set-time gpg-passphrase-timer 
 		    (timer-relative-time (current-time) 
 					 gpg-passphrase-timeout))

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

[-- Attachment #2: Type: application/pgp-signature, Size: 231 bytes --]

             reply	other threads:[~2001-08-07 14:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-07 14:39 Andreas Jaeger [this message]
2001-08-10 17:21 ` ShengHuo ZHU

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ho3d749bo9.fsf@gee.suse.de \
    --to=aj@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).