From 2ef1df3084e2a5fdd310e879899aac3e289a0956 Mon Sep 17 00:00:00 2001 From: Jan-Tarek Butt Date: Tue, 26 Dec 2017 22:51:26 +0100 Subject: [PATCH] gluon-geolocator: refactoring and spellcheck * rm irrelevant else states * fix print message for time stamp file --- .../luasrc/lib/gluon/geolocator/geolocator | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/package/gluon-geolocator/luasrc/lib/gluon/geolocator/geolocator b/package/gluon-geolocator/luasrc/lib/gluon/geolocator/geolocator index 15445501..1be3c55c 100755 --- a/package/gluon-geolocator/luasrc/lib/gluon/geolocator/geolocator +++ b/package/gluon-geolocator/luasrc/lib/gluon/geolocator/geolocator @@ -22,11 +22,10 @@ end if file_exsist(PID_PART) then io.stdout:write("The geolocator is still running.\n") os.exit(0) -else - if io.open(PID_PART, "w") == nil then - io.stdout:write("Can`t create pid file on " .. PID_PART .. "\n") - os.exit(1) - end +end +if io.open(PID_PART, "w") == nil then + io.stdout:write("Can`t create pid file on " .. PID_PART .. "\n") + os.exit(1) end -- Program terminating function including removing of PID file @@ -126,9 +125,8 @@ end local timestap = io.open(TIME_STAMP, "w") if timestap ~= nil then timestap:write(os.time()) -else - io.stdout:write("Can`t create pid file on " .. TIME_STAMP .. "\n") - exit(1) + timestap:close() + exit(0) end -timestap:close() -exit(0) +io.stdout:write("Can`t create file on " .. TIME_STAMP .. "\n") +exit(1)