Fixed bug1058.
authorWerner Koch <wk@gnupg.org>
Fri, 22 May 2009 15:38:49 +0000 (15:38 +0000)
committerWerner Koch <wk@gnupg.org>
Fri, 22 May 2009 15:38:49 +0000 (15:38 +0000)
g10/ChangeLog
g10/signal.c
include/ttyio.h
util/ChangeLog
util/ttyio.c

index 655734b..307428e 100644 (file)
@@ -1,3 +1,7 @@
+2009-05-22  Werner Koch  <wk@g10code.com>
+
+       * signal.c (got_fatal_signal): Call tty_cleanup_after_signal.
+
 2009-05-20  Werner Koch  <wk@g10code.com>
 
        * gpg.c (main): Fix --fingerprint/--with-fingerprint command
index 08c790c..cd24dc0 100644 (file)
@@ -88,6 +88,7 @@ got_fatal_signal( int sig )
     rl_free_line_state ();
     rl_cleanup_after_signal ();
 #endif
+    tty_cleanup_after_signal ();
 
     /* Better don't translate these messages. */
     write(2, "\n", 1 );
index ed064ec..b4fa03d 100644 (file)
@@ -53,5 +53,6 @@ void tty_disable_completion(void);
 #define tty_enable_completion(x)
 #define tty_disable_completion()
 #endif
+void tty_cleanup_after_signal (void);
 
 #endif /*G10_TTYIO_H*/
index 85d5a49..d060fe2 100644 (file)
@@ -1,3 +1,7 @@
+2009-05-22  Werner Koch  <wk@g10code.com>
+
+       * ttyio.c (tty_cleanup_after_signal): New.
+
 2009-05-05  Werner Koch  <wk@g10code.com>
 
        * dotlock.c: Merged changes from GnuPG-2.  Better detection of
index b60a919..2a0c91b 100644 (file)
@@ -122,6 +122,14 @@ cleanup(void)
 }
 #endif
 
+void
+tty_cleanup_after_signal (void)
+{
+#ifdef HAVE_TCGETATTR
+  cleanup ();
+#endif
+}
+
 static void
 init_ttyfp(void)
 {