You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2026/10/21 18:58:24 UTC
(mynewt-newt) 02/09: newt/logcfg: Check error when comparing generated source file
This is an automated email from the ASF dual-hosted git repository.
sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newt.git
commit 37cba1c6ed686bc6b33f278e0a84487c4bf38c96
Author: Szymon Janc <sz...@codecoup.pl>
AuthorDate: Wed Oct 21 09:34:48 2026 +0200
newt/logcfg: Check error when comparing generated source file
The error returned by FileContentsChanged() for the generated
logcfg.c file was ignored, unlike for the header file. A failure to
read the existing file would then silently skip writing the new one.
Assisted-by: Claude:claude-opus-5-5
---
newt/logcfg/logcfg.go | 3 +++
1 file changed, 3 insertions(+)
diff --git a/newt/logcfg/logcfg.go b/newt/logcfg/logcfg.go
index 30e2f5c7..b1966d9b 100644
--- a/newt/logcfg/logcfg.go
+++ b/newt/logcfg/logcfg.go
@@ -376,6 +376,9 @@ func (lcfg *LCfg) EnsureWritten(includeDir string, srcDir string, targetName str
path = fmt.Sprintf("%s/%s-logcfg.c", srcDir, targetName)
writeReqd, err = util.FileContentsChanged(path, srcBuf.Bytes())
+ if err != nil {
+ return err
+ }
if writeReqd {
log.Debugf("logcfg changed; writing source file (%s).", path)