summaryrefslogtreecommitdiff
path: root/debian/patches/01-fix-resize-crash-inside-vim.dpatch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/01-fix-resize-crash-inside-vim.dpatch')
-rwxr-xr-xdebian/patches/01-fix-resize-crash-inside-vim.dpatch55
1 files changed, 55 insertions, 0 deletions
diff --git a/debian/patches/01-fix-resize-crash-inside-vim.dpatch b/debian/patches/01-fix-resize-crash-inside-vim.dpatch
new file mode 100755
index 0000000..e2fe9d2
--- /dev/null
+++ b/debian/patches/01-fix-resize-crash-inside-vim.dpatch
@@ -0,0 +1,55 @@
+#!/bin/sh /usr/share/dpatch/dpatch-run
+## 01-fix-resize-crash-inside-vim.dpatch taken from upstream BTS
+##
+## DP: Fixes a crash on resize when used inside vim
+## DP: (Closes: #374994)
+
+diff -urpN cscope-15.6.orig/src/main.c cscope-15.6/src/main.c
+--- cscope-15.6.orig/src/main.c 2006-10-21 14:42:04.000000000 +0200
++++ cscope-15.6/src/main.c 2006-10-21 14:44:50.000000000 +0200
+@@ -64,7 +64,7 @@
+ #define DFLT_INCDIR "/usr/include"
+ #endif
+
+-static char const rcsid[] = "$Id: main.c,v 1.41 2006/08/20 15:00:34 broeker Exp $";
++static char const rcsid[] = "$Id: main.c,v 1.42 2006/10/10 11:42:17 nhorman Exp $";
+
+ /* note: these digraph character frequencies were calculated from possible
+ printable digraphs in the cross-reference for the C compiler */
+@@ -128,7 +128,8 @@ sigwinch_handler(int sig, siginfo_t *inf
+ (void) sig;
+ (void) info;
+ (void) unused;
+- ungetch(KEY_RESIZE);
++ if(incurses == YES)
++ ungetch(KEY_RESIZE);
+ }
+ #endif
+
+@@ -153,12 +154,6 @@ main(int argc, char **argv)
+ yyout = stdout;
+ /* save the command name for messages */
+ argv0 = argv[0];
+-#if defined(KEY_RESIZE) && !defined(__DJGPP__)
+- winch_action.sa_sigaction = sigwinch_handler;
+- sigemptyset(&winch_action.sa_mask);
+- winch_action.sa_flags = SA_SIGINFO;
+- sigaction(SIGWINCH,&winch_action,NULL);
+-#endif
+ /* set the options */
+ while (--argc > 0 && (*++argv)[0] == '-') {
+ /* HBB 20030814: add GNU-style --help and --version options */
+@@ -403,6 +398,13 @@ cscope: Could not create private temp di
+ signal(SIGINT, SIG_IGN); /* ignore interrupts */
+ signal(SIGPIPE, SIG_IGN);/* | command can cause pipe signal */
+
++#if defined(KEY_RESIZE) && !defined(__DJGPP__)
++ winch_action.sa_sigaction = sigwinch_handler;
++ sigemptyset(&winch_action.sa_mask);
++ winch_action.sa_flags = SA_SIGINFO;
++ sigaction(SIGWINCH,&winch_action,NULL);
++#endif
++
+ /* initialize the curses display package */
+ initscr(); /* initialize the screen */
+ entercurses();
p_module_notify(M) klp_module_notify_coming(P1); klp_module_notify_coming(P2); klp_module_notify_coming(P3); # STATE 2 The ftrace ops for a() and b() then looks: STATE1: ops_a->func_stack -> list(a3,a2,a1); ops_b->func_stack -> list(b3); STATE2: ops_a->func_stack -> list(a3,a2,a1); ops_b->func_stack -> list(b2,b1,b3); therefore, b2() is used for the module but a3() is used for vmcore because they were the last added. Example of the race with going modules: ======================================= CPU0 CPU1 delete_module() #SYSCALL try_stop_module() mod->state = MODULE_STATE_GOING; mutex_unlock(&module_mutex); klp_register_patch() klp_enable_patch() #save place to switch universe b() # from module that is going a() # from core (patched) mod->exit(); Note that the function b() can be called until we call mod->exit(). If we do not apply patch against b() because it is in MODULE_STATE_GOING, it will call patched a() with modified semantic and things might get wrong. [jpoimboe@redhat.com: use one boolean instead of two] Signed-off-by: Petr Mladek <pmladek@suse.cz> Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'kernel/livepatch')