Re: g_serial hangs on write when the cable is disconnected

2015-08-06 Thread Laszlo Papp
Hi Alan, On Wed, Aug 5, 2015 at 7:15 PM, Alan Stern st...@rowland.harvard.edu wrote: On Wed, 5 Aug 2015, Greg KH wrote: hm, wait, is this really the n_gsm line discipline? Or is it something else? g_serial is the device side of a serial connection, there is no cable removed notification

Re: g_serial hangs on write when the cable is disconnected

2015-08-06 Thread Laszlo Papp
On Wed, Aug 5, 2015 at 6:09 PM, Peter Stuge pe...@stuge.se wrote: Greg KH wrote: int fd = open(/dev/ttyGS0, O_RDWR | O_NONBLOCK); This line discipline is very different from the traditional tty line discipline .. this is a character device, with a very specific line discipline

Re: g_serial hangs on write when the cable is disconnected

2015-08-06 Thread Laszlo Papp
On Wed, Aug 5, 2015 at 5:29 PM, Greg KH g...@kroah.com wrote: On Wed, Aug 05, 2015 at 04:40:21PM +0100, Laszlo Papp wrote: On Wed, Aug 5, 2015 at 3:56 PM, Greg KH g...@kroah.com wrote: On Wed, Aug 05, 2015 at 11:05:56AM +0100, Laszlo Papp wrote: Hi, The code below reproduces the issue

Re: g_serial hangs on write when the cable is disconnected

2015-08-06 Thread Laszlo Papp
On Thu, Aug 6, 2015 at 2:52 PM, Alan Stern st...@rowland.harvard.edu wrote: On Thu, 6 Aug 2015, Laszlo Papp wrote: Hi Alan, On Wed, Aug 5, 2015 at 7:15 PM, Alan Stern st...@rowland.harvard.edu wrote: On Wed, 5 Aug 2015, Greg KH wrote: hm, wait, is this really the n_gsm line discipline

Re: g_serial hangs on write when the cable is disconnected

2015-08-06 Thread Laszlo Papp
On Thu, Aug 6, 2015 at 4:16 PM, Peter Hurley pe...@hurleysoftware.com wrote: [ +cc Felipe ] Hi Laszlo, On 08/06/2015 10:03 AM, Laszlo Papp wrote: On Thu, Aug 6, 2015 at 2:52 PM, Alan Stern st...@rowland.harvard.edu wrote: On Thu, 6 Aug 2015, Laszlo Papp wrote: On Wed, Aug 5, 2015 at 7:15

g_serial hangs on write when the cable is disconnected

2015-08-05 Thread Laszlo Papp
Hi, The code below reproduces the issue. The code is intentionally kept small, so it deliberately does not have error checking, et al. Now, my concern is that it blocks for the write operation if the cable is disconnected. This is not inline with the /dev/ttyS* operation, for instance. They

Re: g_serial hangs on write when the cable is disconnected

2015-08-05 Thread Laszlo Papp
On Wed, Aug 5, 2015 at 3:56 PM, Greg KH g...@kroah.com wrote: On Wed, Aug 05, 2015 at 11:05:56AM +0100, Laszlo Papp wrote: Hi, The code below reproduces the issue. The code is intentionally kept small, so it deliberately does not have error checking, et al. Now, my concern is that it blocks