summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2017-12-06 19:56:34 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2017-12-06 20:02:57 +0900
commita627350eed5dc32bac41195462f27dee1987b0f5 (patch)
tree8fad4d299a0c63d07eccc97ab0e0fc05063973a5
parentc39244aa5802d7ec44134def94a5c919752b5491 (diff)
downloadlibassuan-a627350eed5dc32bac41195462f27dee1987b0f5.tar.gz
Use wrapped __assuan_usleep for _assuan_npth_usleep.
* src/assuan.h.in (_assuan_npth_usleep): Wrap __assuan_usleep. -- Assuan should support system hooks for nPth before npth_init. Before the call of npth_init, npth_unprotect and npth_protect do nothing, whiile npth_usleep may crash. No use of npth_usleep is better. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
-rw-r--r--src/assuan.h.in4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/assuan.h.in b/src/assuan.h.in
index f9eddca..9594e73 100644
--- a/src/assuan.h.in
+++ b/src/assuan.h.in
@@ -546,7 +546,9 @@ extern struct assuan_system_hooks _assuan_system_pth;
#define ASSUAN_SYSTEM_NPTH_IMPL \
static void _assuan_npth_usleep (assuan_context_t ctx, unsigned int usec) \
- { (void) ctx; npth_usleep (usec); } \
+ { ssize_t res; (void) ctx; npth_unprotect(); \
+ res = __assuan_usleep (ctx, usec); \
+ npth_protect(); } \
static ssize_t _assuan_npth_read (assuan_context_t ctx, assuan_fd_t fd, \
void *buffer, size_t size) \
{ ssize_t res; (void) ctx; npth_unprotect(); \