Skip to content

Commit e692fc9

Browse files
author
inv2004
committed
fix stream close issue
1 parent 214fcd1 commit e692fc9

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

aur/PKGBUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pkgname=ttop
2-
pkgver=1.5.2
2+
pkgver=1.5.3
33
pkgrel=2
44
pkgdesc="System monitoring tool with historical data service, triggers and top-like TUI"
55
url="https://github.com/inv2004/ttop"

src/ttop/blog.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,14 +162,14 @@ proc save*(): FullInfoRef =
162162
let buf = compress(result[].toJson())
163163
let blog = saveBlog()
164164
let file = open(blog, fmAppend)
165+
defer: file.close()
165166
if flock(file.getFileHandle, 2 or 4) != 0:
166167
writeLine(stderr, "cannot open locked: " & blog)
167168
quit 1
168169
defer: discard flock(file.getFileHandle, 8)
169170
let s = newFileStream(file)
170171
if s == nil:
171172
raise newException(IOError, "cannot open " & blog)
172-
defer: s.close()
173173

174174
s.saveStat result
175175
s.write buf.len.uint32

ttop.nimble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Package
22

3-
version = "1.5.2"
3+
version = "1.5.3"
44
author = "inv2004"
55
description = "Monitoring tool with historical snapshots and alerts"
66
license = "MIT"

0 commit comments

Comments
 (0)