Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171688479
D27154.id82987.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D27154.id82987.diff
View Options
Index: head/Keywords/shell.ucl
===================================================================
--- head/Keywords/shell.ucl
+++ head/Keywords/shell.ucl
@@ -10,7 +10,7 @@
actions: [file]
post-install-lua: <<EOD
shell_path = pkg.prefixed_path("%@")
- shell = io.open("/etc/shells", "r+")
+ shell = assert(io.open("/etc/shells", "r+"))
while true do
line = shell:read()
if line == nil then break end
@@ -20,14 +20,14 @@
return
end
end
- shell:write(shell_path .. "\n")
- shell:close()
+ assert(shell:write(shell_path .. "\n"))
+ assert(shell:close())
EOD
pre-deinstall-lua: <<EOD
shell_path = pkg.prefixed_path("%@")
shellsbuf = ""
shells_path = "/etc/shells"
- shell = io.open(shells_path, "r+")
+ shell = assert(io.open(shells_path, "r+"))
found = false
while true do
line = shell:read()
@@ -38,10 +38,10 @@
shellsbuf = shellsbuf .. line .. "\n"
end
end
- shell:close()
+ assert(shell:close())
if found then
- shell = io.open(shells_path, "w+")
- shell:write(shellsbuf)
- shell:close()
+ shell = assert(io.open(shells_path, "w+"))
+ assert(shell:write(shellsbuf))
+ assert(shell:close())
end
EOD
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Sep 13, 5:33 PM (2 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38866030
Default Alt Text
D27154.id82987.diff (1 KB)
Attached To
Mode
D27154: Add error checks to @shell
Attached
Detach File
Event Timeline
Log In to Comment