Home GnuPG
Diffusion GnuPG b3f1f2cd192b

agent: Handle SCD DEVINFO --watch command in a special way.

Description

agent: Handle SCD DEVINFO --watch command in a special way.

* agent/call-scd.c (devinfo_watch_thread): New.
(agent_card_devinfo): New.
(agent_card_scd): Call agent_card_devinfo when it's
DEVINFO_WATCH_COMMAND.
  • GnuPG-bug-id: T7151
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Event Timeline

werner added inline comments.
/agent/call-scd.c
1242

I fear that SHUT_RDWR is not availabale on all platforms? Why not using the traditional value 2? It is the same for Windows.

Regarding the Windows cast: What do you think about defining a cast macro? Tdis would allow us to do simplify things here to a

shutdown (GPGRT_CAST_SOCK(sock), 2)
gniibe added inline comments.
/agent/call-scd.c
1242

POSIX-wise, the macro SHUT_RDWR is available (on AIX, on *BSD, on GNU system, on HP-UX, and on Solaris).
It's only Windows which doesn't offer the symbol.

On the other hand, I don't know if the value 2 is portable.

Having the socket cast is useful. For assuan, it is internally defined but not exported.
Let us offer those macros by gpgrt.