# HG changeset patch # User Kim Alvefur # Date 1377708130 -7200 # Node ID 1e8b793d8ff9a0a08d0d15868eee59f8420b42ca # Parent a18effacd384d2660c27b5f8f9e8555832215821 mod_lastlog: Return a non-zero exit code if no lastlog records were found diff -r a18effacd384 -r 1e8b793d8ff9 mod_lastlog/mod_lastlog.lua --- a/mod_lastlog/mod_lastlog.lua Wed Aug 28 10:37:23 2013 +0100 +++ b/mod_lastlog/mod_lastlog.lua Wed Aug 28 18:42:10 2013 +0200 @@ -54,7 +54,7 @@ end local user, host = jid.prepped_split(table.remove(arg, 1)); require"core.storagemanager".initialize_host(host); - local lastlog = assert(datamanager.load(user, host, "lastlog")); + local lastlog = datamanager.load(user, host, "lastlog"); if lastlog then print(("Last %s: %s"):format(lastlog.event or "login", lastlog.timestamp and os.date("%Y-%m-%d %H:%M:%S", lastlog.timestamp) or "")); @@ -63,6 +63,7 @@ end else print("No record found"); + return 1; end return 0; end