51 broke -E logic completely, rewise it
[tfcrypt.git] / tfc_signal.c
index 1e025349a52c70e73a6c945d1ac141353ad0bdcc..a81aa1efcd85d9faa1d16d1bfef5eab5dcb7c566 100644 (file)
@@ -30,6 +30,7 @@
 
 void exit_sigterm(int signal)
 {
+       tfc_esay("\n");
        xexit(0);
 }
 
@@ -55,10 +56,9 @@ void print_crypt_status(int signal)
        tfc_yesno finished = NO;
 
        if (last == YES) return;
-       if (signal <= 0) {
+       if (signal == TFC_SIGLAST) {
+               last = YES;
                finished = YES;
-               do_stop = YES; /* error path or sksum finished */
-               if (signal == 0) last = YES;
        }
 
        switch (do_edcrypt) {
@@ -66,6 +66,7 @@ void print_crypt_status(int signal)
                case TFC_DO_DECRYPT: oper_mode = "decrypted"; break;
                default:
                        if (ctr_mode == TFC_MODE_PLAIN) oper_mode = "written";
+                       else if (ctr_mode == TFC_MODE_XOR) oper_mode = "xored";
                        else if (ctr_mode == TFC_MODE_SKSUM) oper_mode = "hashed";
                        else oper_mode = NULL;
                        break;
@@ -129,6 +130,7 @@ void print_crypt_status(int signal)
        }
 
        if (do_stop == NO && do_statline_dynamic == NO) tfc_esay("\n");
+       else if (signal == TFC_SIGLAST || signal == TFC_SIGERR) tfc_esay("\n");
        statline_was_shown = YES;
 
        if ((signal == SIGINT || signal == SIGTERM) && do_stop == YES) exit_sigterm(signal);