LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 02-17-2011, 05:40 PM   #1
johst
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Rep: Reputation: 0
[SOLVED] tty is closed without calling close(?)


I have found a weird behaviour on a linux application. A tty seems to get closed without calling close. The program is (very simplified) as follows:

Process 1:
configure_signals()
read_config_files()
create_threads()
wait(forever)

Thread 1:
fd=open(/dev/ttyXX)
usleep(a while)
config(fd)

I have spent quite a lot of time on this problem. It seems like the file is sometimes closed when reaching config(fd), but removing the usleep(a while) seems to remove the problem. Any ideas what the problem is or where to start looking for the error?

Last edited by johst; 02-18-2011 at 02:37 AM. Reason: Problem solved
 
Old 02-18-2011, 02:37 AM   #2
johst
LQ Newbie
 
Registered: Feb 2011
Posts: 2

Original Poster
Rep: Reputation: 0
[solved]

Forget about this - this was caused by a bug deep inside a lib.
 
  


Reply



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
How to make a SSH persist after tty close.. assasukasse Linux - Software 3 07-01-2010 11:36 AM
How to reset/restart a tty from another tty? armandino Linux - General 4 02-25-2009 03:09 AM
tty driver open and close functions mayank_linux Linux - Networking 0 06-21-2006 07:45 AM
I it possible to kill a tty or find which tty is being using by which process? geletine Linux - Software 2 01-15-2006 08:40 AM
change tty => system crashes (ati driver/tty resolution) mosca Debian 6 08-05-2004 07:37 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:31 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
Open Source Consulting | Domain Registration