head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.30 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.28 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.26 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.2.0.24 pkgsrc-2011Q2-base:1.2 pkgsrc-2009Q4:1.2.0.22 pkgsrc-2009Q4-base:1.2 pkgsrc-2008Q4:1.2.0.20 pkgsrc-2008Q4-base:1.2 pkgsrc-2008Q3:1.2.0.18 pkgsrc-2008Q3-base:1.2 cube-native-xorg:1.2.0.16 cube-native-xorg-base:1.2 pkgsrc-2008Q2:1.2.0.14 pkgsrc-2008Q2-base:1.2 pkgsrc-2008Q1:1.2.0.12 pkgsrc-2008Q1-base:1.2 pkgsrc-2007Q4:1.2.0.10 pkgsrc-2007Q4-base:1.2 pkgsrc-2007Q3:1.2.0.8 pkgsrc-2007Q3-base:1.2 pkgsrc-2007Q2:1.2.0.6 pkgsrc-2007Q2-base:1.2 pkgsrc-2007Q1:1.2.0.4 pkgsrc-2007Q1-base:1.2 pkgsrc-2006Q4:1.2.0.2 pkgsrc-2006Q4-base:1.2; locks; strict; comment @# @; 1.2 date 2006.11.17.15.19.39; author shannonjr; state dead; branches; next 1.1; 1.1 date 2006.10.20.15.23.58; author shannonjr; state Exp; branches; next ; desc @@ 1.2 log @Removing gnupg-devel. It has been replaced by gnupg2. @ text @$NetBSD: patch-aj,v 1.1 2006/10/20 15:23:58 shannonjr Exp $ --- agent/call-pinentry.c.orig 2006-10-20 05:32:59.000000000 -0600 +++ agent/call-pinentry.c @@@@ -300,6 +300,40 @@@@ start_pinentry (ctrl_t ctrl) return 0; } +/* Returns True is the pinentry is currently active. If WAITSECONDS is + greater than zero the function will wait for this many seconds + before returning. */ +int +pinentry_active_p (ctrl_t ctrl, int waitseconds) +{ + if (waitseconds > 0) + { + pth_event_t evt; + int rc; + + evt = pth_event (PTH_EVENT_TIME, pth_timeout (waitseconds, 0)); + if (!pth_mutex_acquire (&entry_lock, 0, evt)) + { + if (pth_event_occurred (evt)) + rc = gpg_error (GPG_ERR_TIMEOUT); + else + rc = gpg_error (GPG_ERR_INTERNAL); + pth_event_free (evt, PTH_FREE_THIS); + return rc; + } + pth_event_free (evt, PTH_FREE_THIS); + } + else + { + if (!pth_mutex_acquire (&entry_lock, 1, NULL)) + return gpg_error (GPG_ERR_LOCKED); + } + + if (!pth_mutex_release (&entry_lock)) + log_error ("failed to release the entry lock at %d\n", __LINE__); + return 0; +} + static int getpin_cb (void *opaque, const void *buffer, size_t length) @ 1.1 log @Re: pkg/34856: upgrade to GnuPG 1.9.93 This release is mainly to fix bugs found in 1.9.92. @ text @d1 1 a1 1 $NetBSD$ @