agent: Simplify agent_popup_message_stop.
authorNIIBE Yutaka <gniibe@fsij.org>
Wed, 14 Nov 2018 01:45:15 +0000 (10:45 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Wed, 14 Nov 2018 01:45:15 +0000 (10:45 +0900)
commit804a77edd9472d44606641b7772550521e1ba271
treeaab18cdca5e112b3fde741e19c0a4d90d5e500c4
parent914fa3be22bf8848a97a7dd405a040d6ef31e2fd
agent: Simplify agent_popup_message_stop.

* agent/call-pinentry.c (agent_popup_message_stop): Just kill it.

--

By checking if it's alive or not, we can lower a risk of sending
SIGINT to a wrong process on unusual condition when PID is re-used to
a different process.

That's true, however, since it's alive usually, simply sending SIGINT
is enough here.

Note that here is a race condition for detecting if process is active
or not;  A process can die just after being detected alive.

Moreover, when the process of pinentry accidentally died already, it
should have caused return of assuan_transact and the thread of
popup_message_thread likely already set popup_finished=1.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
agent/call-pinentry.c