summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg42.2a@gmail.com>2014-02-09 13:57:49 +0100
committerPhilipp Gesang <phg42.2a@gmail.com>2014-02-09 13:57:49 +0100
commit2c73e4165909bc0d82cc62a9031bd687a5e000b6 (patch)
treea997cddfefbeb6aeac9a0fd724fea1e22f812999
parent4ec63fd11536844ed53c16006ac37a33623e61e8 (diff)
downloadluaotfload-2c73e4165909bc0d82cc62a9031bd687a5e000b6.tar.gz
[log] use UUID instead of MD5(time) when creating log files
-rw-r--r--luaotfload-log.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/luaotfload-log.lua b/luaotfload-log.lua
index 938050a..d057eb3 100644
--- a/luaotfload-log.lua
+++ b/luaotfload-log.lua
@@ -19,9 +19,9 @@ local ioopen = io.open
local iowrite = io.write
local lfsisdir = lfs.isdir
local lfsisfile = lfs.isfile
-local md5sumhexa = md5.sumhexa
local osdate = os.date
local ostime = os.time
+local osuuid = os.uuid
local select = select
local stringformat = string.format
local stringsub = string.sub
@@ -75,9 +75,7 @@ local choose_logfile = function ( )
if lfsisdir (tmppath) then
local fname
repeat --- ensure that file of that name doesn’t exist
- --- TODO this could use os.uuid() instead of md5
- fname = tmppath .. "/luaotfload-log-"
- .. stringsub (md5sumhexa (ostime ()), 1, 8)
+ fname = tmppath .. "/luaotfload-log-" .. osuuid()
until not lfsisfile (fname)
iowrite (stringformat (log_msg, fname, fname))
return ioopen (fname, "w")