[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
|