作者hungwen (肥肚子开始紧张)
看板LinuxDev
标题[问题] Serial port读取时 移除device的问题
时间Tue Sep 11 20:30:10 2007
请问高手们
我在跑Linux Serial Programming HOWTO
(
http://tldp.org/HOWTO/Serial-Programming-HOWTO/index.html )
里面的范例时,
读取serial device传进来的资料都没有问题,
但是在读取的时候(范例程式中的while回圈),
当我将serial device拔除时, 这个process就整个消失了.
请问该如何加入判断目前serial device已被拔除,不要做read的动作,
直到到插回去後再继续read 呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.230.49.135
※ 编辑: hungwen 来自: 61.230.49.135 (09/11 20:31)
1F:→ Neo1978:检查所有 function return 值, error handling 要做好.. 09/11 23:19