From eeebb79815a2e5f0f829092c1c6caf2d6a5fb96e Mon Sep 17 00:00:00 2001 From: Ben Kibbey Date: Tue, 16 Oct 2007 20:06:22 -0400 Subject: [PATCH] Call fsync() after write() in save_command() to make sure the data is written to disk. --- src/commands.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/commands.c b/src/commands.c index eac4113b..483b3198 100644 --- a/src/commands.c +++ b/src/commands.c @@ -722,6 +722,13 @@ gpg_error_t do_xml_encrypt(struct client_s *client, gcry_cipher_hd_t gh, return gpg_error_from_errno(len); } + if (fsync(fd) == -1) { + len = errno; + close(fd); + gcry_free(inbuf); + return gpg_error_from_errno(len); + } + if (filename) { close(fd); -- 2.11.4.GIT