Issue a warning instead of ignoring a failed write() completely.

Signed-off-by: Steffan Karger <stef...@karger.me>
---
 src/openvpn/ps.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/openvpn/ps.c b/src/openvpn/ps.c
index b22653b..901a094 100644
--- a/src/openvpn/ps.c
+++ b/src/openvpn/ps.c
@@ -340,7 +340,8 @@ journal_add (const char *journal_dir, struct 
proxy_connection *pc, struct proxy_
       fd = platform_open (jfn, O_CREAT | O_TRUNC | O_WRONLY, S_IRUSR | S_IWUSR 
| S_IRGRP);
       if (fd != -1)
        {
-         write(fd, f, strlen(f));
+         if (write(fd, f, strlen(f)) != strlen(f))
+           msg(M_WARN, "PORT SHARE: writing to journal file (%s) failed", jfn);
          close (fd);
          cp->jfn = jfn;
        }
-- 
1.8.3.2


Reply via email to