summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2009-01-13 16:01:06 +0000
committerTed Trask <ttrask01@yahoo.com>2009-01-13 16:01:06 +0000
commit6e8dc2a910adde579dd57158831d652f0e204676 (patch)
treed39d8017dcee52413b054e2af594310f2873c86c
parent741d9d688f73afff6fa4a9971010499bb831ff99 (diff)
downloadacf-chrony-6e8dc2a910adde579dd57158831d652f0e204676.tar.bz2
acf-chrony-6e8dc2a910adde579dd57158831d652f0e204676.tar.xz
Modified fs.lua to survive nil parameters. Added create_directory and used within create_file and write_file. Reviewed each read_file call to make sure handles nil return value.
git-svn-id: svn://svn.alpinelinux.org/acf/chrony/trunk@1677 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r--chrony-model.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/chrony-model.lua b/chrony-model.lua
index ec0301d..fa8e013 100644
--- a/chrony-model.lua
+++ b/chrony-model.lua
@@ -132,7 +132,7 @@ function get_config()
output.keyfile = cfe({ label="Key File", descr="Name of key file (ie. /etc/chrony/chrony.keys)" })
output.commandkey = cfe({ label="Command Key", descr="Number of key in Key File for commands." })
- local config = format.parse_linesandwords(fs.read_file(configfile), "[!;#%%]")
+ local config = format.parse_linesandwords(fs.read_file(configfile) or "", "[!;#%%]")
if config then
for i,entry in ipairs(config) do
if output[entry[1]] then