]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[client] Fix watch-keystroke cancellation
authorRay Strode <rstrode@redhat.com>
Wed, 30 Jun 2010 20:04:14 +0000 (16:04 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 30 Jun 2010 20:04:14 +0000 (16:04 -0400)
If someone calls --ignore-keystroke then
the watch-keystroke command shouldn't get
run and the exit code should be different
than if it does get run.

src/client/plymouth.c

index f454a21f59c899613b04d15405db5e590c24eab0..ab6f2a9c72fdbeef48ea993e3c139bf295cc3bfc 100644 (file)
@@ -363,6 +363,13 @@ on_key_answer (key_answer_state_t *answer_state,
                const char         *answer,
                ply_boot_client_t  *client)
 {
+
+  if (answer == NULL)
+    {
+      ply_event_loop_exit (answer_state->state->loop, 1);
+      return;
+    }
+
   if (answer_state->command != NULL)
     {
       answer_via_command (answer_state->command, answer, NULL);
@@ -373,9 +380,7 @@ on_key_answer (key_answer_state_t *answer_state,
         write (STDOUT_FILENO, answer, strlen (answer));
     }
 
-  if (answer != NULL)
-    ply_event_loop_exit (answer_state->state->loop, 0);
-  ply_event_loop_exit (answer_state->state->loop, 1);
+  ply_event_loop_exit (answer_state->state->loop, 0);
 }
 
 static void