From 0545d30ac93f0579b8c55d4113fe110c10b5d3b2 Mon Sep 17 00:00:00 2001
From: obarun <eric@obarun.org>
Date: Sun, 6 Aug 2023 19:42:22 +1100
Subject: [PATCH] typo fix and memories

---
 src/lib66/write/write_common.c          |  6 ++----
 src/lib66/write/write_execute_scripts.c |  2 +-
 src/lib66/write/write_logger.c          | 12 +++++++++---
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/lib66/write/write_common.c b/src/lib66/write/write_common.c
index f407098f..8f227392 100644
--- a/src/lib66/write/write_common.c
+++ b/src/lib66/write/write_common.c
@@ -111,10 +111,10 @@ int write_common(resolve_service_t *res, char const *dst)
             int fd ;
             size_t wlen = strlen(what) ;
             char tmp[SS_MAX_PATH_LEN + 1] ;
-            char dest[dstlen + 1 + wlen + 1];
+            char dest[dstlen + 1 + wlen + 1] ;
             char basename[SS_MAX_PATH_LEN + 1] ;
 
-            if (what [0] == '/' ) {
+            if (what[0] == '/' ) {
 
                 auto_strings(tmp, what) ;
 
@@ -184,7 +184,5 @@ int write_common(resolve_service_t *res, char const *dst)
         stralloc_free(&sa) ;
     }
 
-
-
     return 1 ;
 }
diff --git a/src/lib66/write/write_execute_scripts.c b/src/lib66/write/write_execute_scripts.c
index fe850860..d5df3a43 100644
--- a/src/lib66/write/write_execute_scripts.c
+++ b/src/lib66/write/write_execute_scripts.c
@@ -39,7 +39,7 @@ int write_execute_scripts(char const *file, char const *contents, char const *ds
     char run[strlen(contents) + 1] ;
     auto_strings(run, contents) ;
 
-    log_trace("create file: ", dst, "/", file) ;
+    log_trace("write file: ", dst, "/", file) ;
     if (!file_write_unsafe(dst, file, run, FAKELEN))
         log_warnusys_return(LOG_EXIT_ZERO, "write: ", dst, "/", file) ;
 
diff --git a/src/lib66/write/write_logger.c b/src/lib66/write/write_logger.c
index d175fa21..517d50bd 100644
--- a/src/lib66/write/write_logger.c
+++ b/src/lib66/write/write_logger.c
@@ -77,7 +77,13 @@ void write_logger(resolve_service_t *res, char const *destination, uint8_t force
         parse_cleanup(res, destination, force) ;
         log_dieusys(LOG_EXIT_SYS, "create directory: ", res->sa.s + res->logger.destination) ;
     }
-
+    /**
+     * ISSUE: In case of e.g. earlier service the log
+     * may point to a tmpfs directory. At next reboot
+     * the log directory will not be present. We just
+     * react as oneshot service making it at .run file
+     * with execl-toc.
+     */
     if (!owner && ((res->execute.run.build == BUILD_AUTO) || (!res->execute.run.build))) {
 
         if (!youruid(&log_uid, logrunner) || !yourgid(&log_gid, log_uid)) {
@@ -93,7 +99,7 @@ void write_logger(resolve_service_t *res, char const *destination, uint8_t force
     char write[strlen(destination) + 10] ;
 
     /** run script */
-    log_trace("create file: ", destination, "/run") ;
+    log_trace("write file: ", destination, "/run") ;
     if (!file_write_unsafe(destination, "run", res->sa.s + res->execute.run.run, strlen(res->sa.s + res->execute.run.run))) {
         parse_cleanup(res, destination, force) ;
         log_dieusys(LOG_EXIT_SYS, "write: ", destination, "/run.user") ;
@@ -107,7 +113,7 @@ void write_logger(resolve_service_t *res, char const *destination, uint8_t force
     }
 
     /** run.user script */
-    log_trace("create file: ", destination, "/run.user") ;
+    log_trace("write file: ", destination, "/run.user") ;
     if (!file_write_unsafe(destination, "run.user", res->sa.s + res->execute.run.run_user, strlen(res->sa.s + res->execute.run.run_user))) {
         parse_cleanup(res, destination, force) ;
         log_dieusys(LOG_EXIT_SYS, "write: ", destination, "/run.user") ;
-- 
GitLab