From 677db9ffe0b9ea79bb52ffacc5ccb964e261093a Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Mon, 14 Mar 2011 21:29:50 -0700 Subject: [PATCH 1/1] Send close command when cleaning up keyd backend Previously we just shutdown the socket; we should really tell keyd we're disappearing as well. --- keydb_keyd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/keydb_keyd.c b/keydb_keyd.c index 3f199bd..dcdcb85 100644 --- a/keydb_keyd.c +++ b/keydb_keyd.c @@ -103,6 +103,15 @@ static void keyd_initdb(bool readonly) */ static void keyd_cleanupdb(void) { + int cmd = KEYD_CMD_CLOSE; + + if (write(keyd_fd, &cmd, sizeof(cmd)) != sizeof(cmd)) { + logthing(LOGTHING_CRITICAL, + "Couldn't send close cmd: %s (%d)", + strerror(errno), + errno); + } + if (shutdown(keyd_fd, SHUT_RDWR) < 0) { logthing(LOGTHING_NOTICE, "Error shutting down socket: %d", errno); -- 2.39.5