diff --git a/client/main.c b/client/main.c
index 774c0cd..ae8aa92 100644
--- a/client/main.c
+++ b/client/main.c
static GList *ctrl_list;
static GList *dev_list;
+static guint input = 0;
+
static const char * const agent_arguments[] = {
"on",
"off",
switch (si.ssi_signo) {
case SIGINT:
- rl_replace_line("", 0);
- rl_crlf();
- rl_on_new_line();
- rl_redisplay();
- break;
+ if (input) {
+ rl_replace_line("", 0);
+ rl_crlf();
+ rl_on_new_line();
+ rl_redisplay();
+ break;
+ }
+
+ /*
+ * If input was not yet setup up that means signal was received
+ * while daemon was not yet running. Since user is not able
+ * to terminate client by CTRL-D or typing exit treat this as
+ * exit and fall through.
+ */
case SIGTERM:
if (__terminated == 0) {
rl_replace_line("", 0);
GOptionContext *context;
GError *error = NULL;
GDBusClient *client;
- guint signal, input;
+ guint signal;
context = g_option_context_new(NULL);
g_option_context_add_main_entries(context, options, NULL);