diff options
author | NIIBE Yutaka <[email protected]> | 2018-09-10 00:16:50 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2018-09-10 00:16:50 +0000 |
commit | adce73b86fd49d5bbb8884231a26cc7533d400e2 (patch) | |
tree | fbc8fe91e9520299edd82baf093d4c515cdae6ee /agent/call-pinentry.c | |
parent | dirmngr: Emit SOURCE status also on NO_DATA. (diff) | |
download | gnupg-adce73b86fd49d5bbb8884231a26cc7533d400e2.tar.gz gnupg-adce73b86fd49d5bbb8884231a26cc7533d400e2.zip |
agent: Fix error code check from npth_mutex_init.
* agent/call-pinentry.c (initialize_module_call_pinentry): It's an
error when npth_mutex_init returns non-zero.
--
Actually, initialize_module_call_pinentry is only called once from
main. So, this bug had no harm and having the static variable
INITIALIZED is not needed.
Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'agent/call-pinentry.c')
-rw-r--r-- | agent/call-pinentry.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/agent/call-pinentry.c b/agent/call-pinentry.c index af4eb06f2..048443ab3 100644 --- a/agent/call-pinentry.c +++ b/agent/call-pinentry.c @@ -98,11 +98,15 @@ void initialize_module_call_pinentry (void) { static int initialized; + int err; if (!initialized) { - if (npth_mutex_init (&entry_lock, NULL)) - initialized = 1; + err = npth_mutex_init (&entry_lock, NULL); + if (err) + log_fatal ("error initializing mutex: %s\n", strerror (err)); + + initialized = 1; } } |