aboutsummaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/main.cpp8
-rw-r--r--src/daemon/rpc_command_executor.cpp2
2 files changed, 3 insertions, 7 deletions
diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp
index 461888062..cb288071e 100644
--- a/src/daemon/main.cpp
+++ b/src/daemon/main.cpp
@@ -312,9 +312,7 @@ int main(int argc, char const * argv[])
{
login = tools::login::parse(
has_rpc_arg ? command_line::get_arg(vm, arg.rpc_login) : std::string(env_rpc_login), false, [](bool verify) {
-#ifdef HAVE_READLINE
- rdln::suspend_readline pause_readline;
-#endif
+ PAUSE_READLINE();
return tools::password_container::prompt(verify, "Daemon client password");
}
);
@@ -336,9 +334,7 @@ int main(int argc, char const * argv[])
}
else
{
-#ifdef HAVE_READLINE
- rdln::suspend_readline pause_readline;
-#endif
+ PAUSE_READLINE();
std::cerr << "Unknown command: " << command.front() << std::endl;
return 1;
}
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index 4d3debed6..670affd76 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -66,7 +66,7 @@ namespace {
time(&now);
time_t last_seen = static_cast<time_t>(peer.last_seen);
- std::string elapsed = epee::misc_utils::get_time_interval_string(now - last_seen);
+ std::string elapsed = peer.last_seen == 0 ? "never" : epee::misc_utils::get_time_interval_string(now - last_seen);
std::string id_str = epee::string_tools::pad_string(epee::string_tools::to_string_hex(peer.id), 16, '0', true);
std::string port_str;
epee::string_tools::xtype_to_string(peer.port, port_str);