diff --git a/aur/PKGBUILD b/aur/PKGBUILD index 2533d12..d183565 100644 --- a/aur/PKGBUILD +++ b/aur/PKGBUILD @@ -1,5 +1,5 @@ pkgname=ttop -pkgver=1.5.2 +pkgver=1.5.3 pkgrel=2 pkgdesc="System monitoring tool with historical data service, triggers and top-like TUI" url="https://github.com/inv2004/ttop" diff --git a/src/ttop/blog.nim b/src/ttop/blog.nim index 781f757..5fb4cff 100644 --- a/src/ttop/blog.nim +++ b/src/ttop/blog.nim @@ -162,6 +162,7 @@ proc save*(): FullInfoRef = let buf = compress(result[].toJson()) let blog = saveBlog() let file = open(blog, fmAppend) + defer: file.close() if flock(file.getFileHandle, 2 or 4) != 0: writeLine(stderr, "cannot open locked: " & blog) quit 1 @@ -169,7 +170,6 @@ proc save*(): FullInfoRef = let s = newFileStream(file) if s == nil: raise newException(IOError, "cannot open " & blog) - defer: s.close() s.saveStat result s.write buf.len.uint32 diff --git a/ttop.nimble b/ttop.nimble index 97b136f..e5710e6 100644 --- a/ttop.nimble +++ b/ttop.nimble @@ -1,6 +1,6 @@ # Package -version = "1.5.2" +version = "1.5.3" author = "inv2004" description = "Monitoring tool with historical snapshots and alerts" license = "MIT"