LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-23-2010, 07:24 PM   #1
fbasma
LQ Newbie
 
Registered: Oct 2009
Location: USA/OKlahoma
Posts: 7

Rep: Reputation: 0
Serial Port Connection


hello ,

i'm trying to access one of the serial ports, i've used the code posted in the the following website: http://www.tldp.org/HOWTO/Serial-Pro...OWTO/x115.html

The connection works , i start reading from the port, however when i terminate the program ( Control C), i try to reactivate it again , but nothing happens ( it seems like going in an infinite loop). the only way to fix it is to remove the cable and then plug it back again.

any ideas why this is going on ?

I'm using slackware 2.6.31


Thanks in advance.
 
Old 02-23-2010, 09:23 PM   #2
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 129Reputation: 129
When you open a file, close it. A device is a file too in Linux. Be sure when Ctrl+C is pressed to free your ressources, and not just terminate the program. You have to listen to signals (SIGQUIT, SIGKILL) to do that.
 
Old 02-24-2010, 11:15 AM   #3
fbasma
LQ Newbie
 
Registered: Oct 2009
Location: USA/OKlahoma
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks alot,

if your referring to the process itself, i've already checked its execution, however, i thought once the process itself is killed , the resources are freed as well. If that is not the case , how can i check the resources used by the process itself?


however what i did is tried the same program under fedora , it worked fine, i couldn't even replicate the problem.
i was wondering whether the problem might be with either the kernel version or with slackware.

Thanks again.
 
Old 02-24-2010, 07:30 PM   #4
Elv13
Member
 
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 129Reputation: 129
the fuser and lsof command will help. But -always- close your resources manually, killing wont free all. A serial connection is kind of stupid, it does not detect the end until you call it. It may be the problem.
 
  


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
Internet connection share via serial port dpeterson3 Linux - Networking 3 10-21-2009 05:36 PM
Serial port connection scbops Linux - Networking 8 04-23-2007 04:47 AM
linux serial port to router console port connection? frankie_fix Linux - General 3 02-26-2007 09:32 PM
serial port network connection eantoranz Linux - Networking 2 10-31-2005 08:05 AM
How to probe if a serial port has a valid connection? RedDrake Linux - General 2 09-01-2005 07:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:40 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