[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] [PATCH 3/3] Enable Windows version of gpspipe
From: |
Robert Norris |
Subject: |
Re: [gpsd-dev] [PATCH 3/3] Enable Windows version of gpspipe |
Date: |
Sun, 5 Mar 2017 12:42:24 +0000 |
>> Use recv() rather than read() for Windows compatibility.
> This seems like a good idea in general, though again it would be better to
> confine the conditional include stuff to os_compat.h.
This isn't a conditional. Using recv() with a 0 for the third parameter is
equivalent to using read().
However on Windows read() doesn't work with sockets, hence the need to use
recv() instead.
HAVE_SELECT_H -> D'oh!
select() on Windows is available via winsock2.h
NB with the syslog compatibility patch (which I'll rework as requested) -
gpxlogger builds without further changes.
--
Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.
________________________________________
From: gpsd-dev <address@hidden> on behalf of Fred Wright <address@hidden>
Sent: 04 March 2017 23:22:41
To: address@hidden
Subject: Re: [gpsd-dev] [PATCH 3/3] Enable Windows version of gpspipe
On Fri, 24 Feb 2017, Robert Norris wrote:
> Use recv() rather than read() for Windows compatibility.
This seems like a good idea in general, though again it would be better to
confine the conditional include stuff to os_compat.h.
The select-related stuff has issues here:
1) It's testing the nonexistent HAVE_SELECT_H instead of
HAVE_SYS_SELECT_H, so it's not including select.h on *any* platform.
2) It doesn't have an alternative for select.h in the Windows case, but is
still using select().
I believe the reason neither of these is causing trouble is due to an
indirect include via some other header, but that's fragile.
> Disable options not available on Windows (serial port, daemonize).
Again, at least until there's conditional manpage content, it's probably
better to include the non-working options, as long as the code builds and
fails correctly.
BTW, if daemonization support *were* conditional, it would be better to
define a flag for that specific purpose in os_compat.h, rather than
exposing the relationship between daemonization and fork().
Fred Wright