mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-18 14:17:03 +01:00
agent,scd: Use pointer to represent HANDLE.
* agent/call-scd.c [HAVE_W32_SYSTEM] (start_scd): Format with %p. * scd/command.c [HAVE_W32_SYSTEM] (option_handler): Use void *. Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
parent
02dce8c0cc
commit
96918346be
@ -404,8 +404,8 @@ start_scd (ctrl_t ctrl)
|
|||||||
char buf[100];
|
char buf[100];
|
||||||
|
|
||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
snprintf (buf, sizeof buf, "OPTION event-signal=%lx",
|
snprintf (buf, sizeof buf, "OPTION event-signal=%p",
|
||||||
(unsigned long)get_agent_scd_notify_event ());
|
get_agent_scd_notify_event ());
|
||||||
#else
|
#else
|
||||||
snprintf (buf, sizeof buf, "OPTION event-signal=%d", SIGUSR2);
|
snprintf (buf, sizeof buf, "OPTION event-signal=%d", SIGUSR2);
|
||||||
#endif
|
#endif
|
||||||
|
@ -79,7 +79,7 @@ struct server_local_s
|
|||||||
assuan_context_t assuan_ctx;
|
assuan_context_t assuan_ctx;
|
||||||
|
|
||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
unsigned long event_signal; /* Or 0 if not used. */
|
void *event_signal; /* Or NULL if not used. */
|
||||||
#else
|
#else
|
||||||
int event_signal; /* Or 0 if not used. */
|
int event_signal; /* Or 0 if not used. */
|
||||||
#endif
|
#endif
|
||||||
@ -178,7 +178,11 @@ option_handler (assuan_context_t ctx, const char *key, const char *value)
|
|||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
if (!*value)
|
if (!*value)
|
||||||
return gpg_error (GPG_ERR_ASS_PARAMETER);
|
return gpg_error (GPG_ERR_ASS_PARAMETER);
|
||||||
ctrl->server_local->event_signal = strtoul (value, NULL, 16);
|
#ifdef _WIN64
|
||||||
|
ctrl->server_local->event_signal = (void *)strtoull (value, NULL, 16);
|
||||||
|
#else
|
||||||
|
ctrl->server_local->event_signal = (void *)strtoul (value, NULL, 16);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
int i = *value? atoi (value) : -1;
|
int i = *value? atoi (value) : -1;
|
||||||
if (i < 0)
|
if (i < 0)
|
||||||
@ -1933,20 +1937,20 @@ send_client_notifications (app_t app, int removal)
|
|||||||
pid = assuan_get_pid (sl->assuan_ctx);
|
pid = assuan_get_pid (sl->assuan_ctx);
|
||||||
|
|
||||||
#ifdef HAVE_W32_SYSTEM
|
#ifdef HAVE_W32_SYSTEM
|
||||||
handle = (void *)sl->event_signal;
|
handle = sl->event_signal;
|
||||||
for (kidx=0; kidx < killidx; kidx++)
|
for (kidx=0; kidx < killidx; kidx++)
|
||||||
if (killed[kidx].pid == pid
|
if (killed[kidx].pid == pid
|
||||||
&& killed[kidx].handle == handle)
|
&& killed[kidx].handle == handle)
|
||||||
break;
|
break;
|
||||||
if (kidx < killidx)
|
if (kidx < killidx)
|
||||||
log_info ("event %lx (%p) already triggered for client %d\n",
|
log_info ("event %p (%p) already triggered for client %d\n",
|
||||||
sl->event_signal, handle, (int)pid);
|
sl->event_signal, handle, (int)pid);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_info ("triggering event %lx (%p) for client %d\n",
|
log_info ("triggering event %p (%p) for client %d\n",
|
||||||
sl->event_signal, handle, (int)pid);
|
sl->event_signal, handle, (int)pid);
|
||||||
if (!SetEvent (handle))
|
if (!SetEvent (handle))
|
||||||
log_error ("SetEvent(%lx) failed: %s\n",
|
log_error ("SetEvent(%p) failed: %s\n",
|
||||||
sl->event_signal, w32_strerror (-1));
|
sl->event_signal, w32_strerror (-1));
|
||||||
if (killidx < DIM (killed))
|
if (killidx < DIM (killed))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user