~ubuntu-branches/ubuntu/dapper/newt/dapper

« back to all changes in this revision

Viewing changes to debian/patches/70_sighup_whiptail.patch

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2005-03-22 12:44:37 UTC
  • mfrom: (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050322124437-nuhl0pqjcijjno9z
Tags: 0.51.6-20ubuntu3
Add Xhosa translation (thanks, Adi Attar).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
diff -ruN newt-0.51.6-old/whiptail.c newt-0.51.6/whiptail.c
 
2
--- newt-0.51.6-old/whiptail.c  2004-03-01 14:32:21.000000000 +0000
 
3
+++ newt-0.51.6/whiptail.c      2004-03-01 14:40:03.000000000 +0000
 
4
@@ -4,6 +4,7 @@
 
5
 #include <stdio.h>
 
6
 #include <string.h>
 
7
 #include <stdlib.h>
 
8
+#include <signal.h>
 
9
 #include <unistd.h>
 
10
 #include <wchar.h>
 
11
 #include <slang.h>
 
12
@@ -34,6 +35,10 @@
 
13
     exit(DLG_ERROR);
 
14
 }
 
15
 
 
16
+static void handleSighup(int signum) {
 
17
+       exit(DLG_ERROR);
 
18
+}
 
19
+
 
20
 /* FIXME Copied from newt.c
 
21
  * Place somewhere better -- dialogboxes? -- amck
 
22
  */
 
23
@@ -283,9 +288,10 @@
 
24
     poptContext optCon;
 
25
     int arg;
 
26
     const char * optArg;
 
27
-    const char * text;
 
28
+    char * text;
 
29
     const char * nextArg;
 
30
     char * end;
 
31
+    struct sigaction sa;
 
32
     int height;
 
33
     int width;
 
34
     int fd = -1;
 
35
@@ -433,6 +439,10 @@
 
36
        if (open("/dev/tty", O_RDWR) != 0) perror("open /dev/tty");
 
37
     }
 
38
 
 
39
+    memset(&sa, 0, sizeof(sa));
 
40
+    sa.sa_handler = handleSighup;
 
41
+    sigaction(SIGWINCH, &sa, NULL);
 
42
+
 
43
     newtInit();
 
44
     newtCls();
 
45