From: SourceForge.net <no...@so...> - 2006-10-21 15:34:59
|
Bugs item #1574354, was opened at 2006-10-10 02:18 Message generated for change (Comment added) made by nobody You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104664&aid=1574354&group_id=4664 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Linebased interface Group: None Status: Closed Resolution: Accepted Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Neil Horman (nhorman) Summary: SIGSEGV on resize (with patch Initial Comment: SIGWINCH handler calls ungetch whether ncurses is initialized or not. It is really annoying when you resize vim, and cscope crashes, so I'm attaching an "it works for me" fix. Domen Puncer <do...@co...> ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-10-21 08:34 Message: Logged In: NO With current CVS code, If I change the terminal window size of a single line mode cscope, cscope will exit because the SIGWINCH signal will interrupt single line mode's fgets() call and cause cscope to exit. I think it's may be better if the single line mode ignore SIGWINCH signal. Regards, - LvJin ar...@gm... ---------------------------------------------------------------------- Comment By: Neil Horman (nhorman) Date: 2006-10-20 05:25 Message: Logged In: YES user_id=827328 "Current cscope CVS code will still exit on a SIGWINCH signal in single line mode at src/main.c:610, though it doesn't SIGSEGV now." What exactly do you mean by this? Either its working or its broken currently. ---------------------------------------------------------------------- Comment By: Nobody/Anonymous (nobody) Date: 2006-10-20 02:32 Message: Logged In: NO Current cscope CVS code will still exit on a SIGWINCH signal in single line mode at src/main.c:610, though it doesn't SIGSEGV now. This patch will only register sigaction for SIGWINCH in curses mode. Thus SIGWINCH signal won't hurt single line mode any more. Regards, - LvJin ar...@gm... Index: src/main.c =================================================================== RCS file: /cvsroot/cscope/cscope/src/main.c,v retrieving revision 1.42 diff -u -p -r1.42 main.c --- src/main.c 10 Oct 2006 11:42:17 -0000 1.42 +++ src/main.c 20 Oct 2006 09:16:19 -0000 @@ -154,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 +397,12 @@ cscope: Could not create private temp di if (linemode == NO) { 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 */ ---------------------------------------------------------------------- Comment By: Neil Horman (nhorman) Date: 2006-10-10 04:23 Message: Logged In: YES user_id=827328 The patch looks fine to me, I'll check it in shortly. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104664&aid=1574354&group_id=4664 |