Diffusion GPGME 129def87b262

core, w32: Add hack to translate diag logger-fd

Authored by aheinecke on Mar 25 2019, 2:56 PM.

Description

core, w32: Add hack to translate diag logger-fd

* src/assuan-support.c (my_spawn): Add hack to
mark the logger fd for w32spawn translation.

The w32 spawn code needs to modify argv with
an updated fd that matches the real id
in the spawned process.

It uses spawn_fd_item_s.arg_loc for that.
We hack it here so that the arg_loc is set
for gpgsm's logger-fd without changing
the assuan API.

Details

werner added a subscriber: werner.Mar 25 2019, 5:57 PM
werner added inline comments.
/src/assuan-support.c
237

That should either be strtol (because logger_fd is a long) or if you change logger-fd to an ulong you need to use the errno=0/strtoul/if dance fortunately available as _gpgme_strtoul_field.

aheinecke marked an inline comment as done.Mar 26 2019, 4:39 PM

I changed it. My rationale to check for <=0 here was to catch "-1" invalid handle values that might be somehow created / passed and not caught earlier.