gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] gpsd: skip tcdrain() when closing in readonly mode


From: Jean Pierre TOSONI
Subject: Re: [gpsd-dev] gpsd: skip tcdrain() when closing in readonly mode
Date: Wed, 2 May 2018 15:05:54 +0000

Hello List,

I submitted the patch below about two months ago. Any chance it gets through, 
or at least gets some comments back if something is wrong?

Best regards,

Jean-Pierre Tosoni

> -----Message d'origine-----
> De : gpsd-dev [mailto:address@hidden De la part de Jean Pierre
> TOSONI
> Envoyé : lundi 12 mars 2018 10:52
> À : address@hidden
> Objet : [gpsd-dev] gpsd: skip tcdrain() when closing in readonly mode
> 
> The Quectel EC25 device used with the Linux 3.10.20 usb/option driver
> makes gpsd hang when it closes the serial port after receiving a SIGTERM.
> 
> Hanging is caused by the call to tcdrain(), which happens even when
> gpsd is in read-only mode (-b argument).
> 
> In this mode, since nothing is ever written to the serial port, the
> tcdrain call is not needed. Skip it.
> 
> --- a/serial.c
> +++ b/serial.c
> @@ -727,7 +727,8 @@ void gpsd_close(struct gps_device_t *ses
>  #ifdef TIOCNXCL
>         (void)ioctl(session->gpsdata.gps_fd, (unsigned long)TIOCNXCL);
>  #endif /* TIOCNXCL */
> -       (void)tcdrain(session->gpsdata.gps_fd);
> +       if (!session->context->readonly)
> +               (void)tcdrain(session->gpsdata.gps_fd);
>         if (isatty(session->gpsdata.gps_fd) != 0) {
>             /* force hangup on close on systems that don't do HUPCL properly 
> */
>             (void)cfsetispeed(&session->ttyset, (speed_t) B0);
> --
> quilt 0.48




reply via email to

[Prev in Thread] Current Thread [Next in Thread]