summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mkelf.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/mkelf.lua b/mkelf.lua
index a811a57..6a90504 100644
--- a/mkelf.lua
+++ b/mkelf.lua
@@ -272,12 +272,11 @@ local function main()
output = arg[i + 1]
::continue::
end
- local f = assert(io.open(output, "wb"))
+ local f <close> = assert(io.open(output, "wb"))
header.phnum = #phdrs
header.phentsize = (header.class == Class.bit64) and 0x38 or 0x20
f:write(ElfHeader_pack(header))
f:write(ElfPHeader_pack(phdrs, header.data, header.class))
- f:close()
end
main()