]> git.pld-linux.org Git - packages/rpm-build-macros.git/blobdiff - rpm.macros
- close only if f is valid
[packages/rpm-build-macros.git] / rpm.macros
index 45ac6215ed00f0563edc353146675f4aadc1513d..8064a617355b118a39bcc11c77b7b1344ce49091 100644 (file)
@@ -1608,6 +1608,7 @@ fi \
 f = io.open("%{_docdir}/%{name}-%{version}/optional-packages.txt", "r") \
 if f then \
        for l in f:lines() do print(l); end \
+       f.close() \
 end \
 %{nil}
 
@@ -1988,7 +1989,11 @@ s=""\
 for _, l in pairs(t) do\
        s=s..l.."\\n"\
 end\
-io.open("/etc/shells", "w"):write(s)\
+f = io.open("/etc/shells", "w")\
+if f then\
+       write(s)\
+       f:close()\
+end\
 %{nil}
 
 # Backwards compat. Use of %lua_ prefixed macros is preferred as these are cleaner to read.
This page took 0.029064 seconds and 4 git commands to generate.