LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 11-21-2005, 06:42 AM   #1
arunka
Member
 
Registered: Mar 2005
Posts: 60

Rep: Reputation: 15
kill -9 for ncurses application problem


hi all
i have written a muti-threaded application using ncurses.
Now if i give a command "kill -9 <pid of the any thread>"
sometimes i am console is not returning to normal mode, though all the threads are getting killed.

Do anyone has an idea why it is happenning???

Thanks in advance.

Arun KA
 
Old 11-21-2005, 11:58 AM   #2
crabboy
Moderator
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,823

Rep: Reputation: 120Reputation: 120
ncurses is chaning the properties of your console to get it to do what it wants. Killing the process with -9 does not allow ncurses to clean up it's mess and set your console properties back to the original settings.

You can try running an 'stty sane' after the program exists to see if those settings give you something that you can work with without restarting your window.
 
Old 11-27-2005, 01:09 PM   #3
dogpatch
Member
 
Registered: Nov 2005
Location: Central America
Distribution: Mepis, Android
Posts: 175
Blog Entries: 1

Rep: Reputation: 19
I think handling the term signal inside your code will avoid this. Somewhere near the startup of your program, include the following:



Code:
signal(SIGTERM,MyTermRtn);
with a routine to handle this condition:

Code:
void MyTermRtn(){
        endwin(); /* tell ncurses to clean up */
        (other term logic)
        }
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
kill procesed application fireedo Suse/Novell 4 05-10-2005 12:24 PM
x server kill application keyboard shortcut/hotkey hypermegachi Linux - Newbie 2 07-25-2004 03:37 PM
kill and detect spesific application melinda_sayang Programming 5 05-23-2004 04:38 AM
Kill -9 not killing application, connected with cdrom busy error? vdemuth Linux - Software 5 04-11-2004 03:33 PM
ncurses-5.2-28 conflicts with file from package ncurses-5.2-12 tubby Linux - Software 4 06-16-2002 01:00 AM


All times are GMT -5. The time now is 01:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration