aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/roottail/files/patch-aa
blob: cc752b4659dcf07be4a687d8b9c7963ee3ade904 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--- root-tail.c.orig    Thu Apr  8 21:58:28 2004
+++ root-tail.c Wed Jun 23 14:06:13 2004
@@ -152,6 +152,7 @@
 void list_files (int);
 void force_reopen (int);
 void force_refresh (int);
+void exit_now (int);
 void blank_window (int);
 
 void InitWindow (void);
@@ -198,6 +199,13 @@
 }
 
 void
+exit_now (int signal)
+{
+  fprintf (stderr, "Program exiting due to signal: %d\n", signal);
+  exit(-1);
+}
+
+void
 blank_window (int dummy)
 {
   XClearArea (disp, root, win_x, win_y, width + MARGIN_OF_ERROR, height, False);
@@ -655,11 +663,12 @@
 char *
 concat_line (char *p1, const char *p2)
 {
+  int l1,l2;
+  char *r;
   assert(p2);
 
-  int l1 = p1 ? strlen (p1) : 0;
-  int l2 = strlen (p2);
-  char *r;
+  l1 = p1 ? strlen (p1) : 0;
+  l2 = strlen (p2);
 
   if (p1)
     r = xrealloc(p1, l1 + l2 + 1);
@@ -925,6 +934,7 @@
       int wrapped = 0;
       char *break_p = NULL;
       int width_at_break_p = 0;
+      int prefix_len;
       spaces = 0;
 
       if (opt_justify)
@@ -992,7 +1002,6 @@
       if (!wrapped)
         break;
 
-      int prefix_len;
 
       /* choose where to break the line */
       if (opt_wordwrap && break_p && break_p != beg)
@@ -1501,6 +1510,7 @@
   install_signal (SIGHUP, force_reopen);
   install_signal (SIGUSR1, list_files);
   install_signal (SIGUSR2, force_refresh);
+  install_signal (SIGSEGV, exit_now);
 
   if (opt_daemonize)
     daemonize ();