summaryrefslogtreecommitdiff
path: root/libgps_shm.c
Commit message (Collapse)AuthorAgeFilesLines
* libgps_shm: Stop clobbering gpsdate->statusGary E. Miller2019-02-061-4/+0
|
* Address Savannah bug #53846, gps_shm_open() should ↵Eric S. Raymond2018-12-261-0/+1
| | | | reset...PRIVATE(gpsdata)->tick
* LICENSE: Update licenses for consistency. No functional changes.Gary E. Miller2018-11-191-1/+1
|
* SPDXify the licerse references.Eric S. Raymond2018-03-081-1/+1
|
* This timeout parameter is usedRobert Norris2017-03-041-1/+1
| | | | | | | | | Thus remove the 'UNUSED' compiler hint. TESTED: Still compiles without any complaints Signed-off-by: Fred Wright <fw@fwright.net>
* Initial creation of os_compat.h.Fred Wright2017-01-221-1/+0
| | | | | | | | | | | | | | | | | This creates a header for os_compat.c, and moves the related prototypes into it from gpsd_config.h (as created by SConstruct), after adding references to it to gpsd.h (via gpsd.h-tail) and a few other sources that need it but don't include gpsd.h. It also removes includes of <time.h> in the places where they were only needed for the code now removed from gpsd_config.h. TESTED: Ran "scons build-all check" on OSX 10.9 (with strlcat/strlcpy but no clock_gettime), OSX 10.12 (with strlcat/strlcpy and clock_gettime), and Ubuntu 14 (with clock_gettime but no strlcat/strlcpy). Also verified that fallback versions were not being included where unnecessary.
* sys/ipc.h needs XOPEN_SOURCE 500Gary E. Miller2016-08-151-1/+1
| | | | XOPEN_SOURCE 500 means X/Open 1995. Seems saef enough.
* Fix a warning when C99 specified.Gary E. Miller2016-08-151-0/+4
| | | | | | | | In file included from libgps_shm.c:27:0: /usr/include/sys/ipc.h:24:3: warning: #warning "Files using this header must be compiled with _GNU_SOURCE or _XOPEN_SOURCE" [-Wcpp] # warning "Files using this header must be compiled with _GNU_SOURCE or _XOPEN_S
* Improved resilience in gps_shm_close() in case it is called after an ↵Robert Norris2016-08-021-1/+1
| | | | | | | | unsuccessful gps_shm_open() Check that the structure exists before trying to use a component of it. Signed-off-by: Gary E. Miller <gem@rellim.com>
* Prevent client crashes if one calls gps_close() multiple timesRobert Norris2016-08-021-0/+1
| | | | | | | | privdata must be explicitly set to NULL after use, otherwise if gps_close() is (incorrectly) called again before a new gps_open() then a double free condition can occur. Signed-off-by: Gary E. Miller <gem@rellim.com>
* Fatal typo broke the build. Oops.Eric S. Raymond2016-01-171-1/+1
|
* Simpler fix for fd clobbering in the SHM library interface.Eric S. Raymond2016-01-171-3/+7
|
* Prevent gps fd from being stimpeed by shated-memory interface.Eric S. Raymond2016-01-161-1/+2
| | | | Fix due to Simon Hradecky <shradecky@nomissoft.com>.
* Fix memory leak in case of shmat() failureZbigniew Chyla2015-06-011-0/+1
|
* Fix checking the result of shmat() callZbigniew Chyla2015-06-011-1/+1
| | | | The code was checking "privdata" pointer instead of shmat() result.
* Revert "Copy structs using assignment, not memcpy()."Gary E. Miller2015-04-281-2/+6
| | | | | | | | | | | | | | | | | | | | This reverts commit d1965788249d7e22cdde4021d452cf0dc6c6b9bd. This breaks my build on Gentoo running gcc 4.9.2 libgps_shm.c: In function 'int gps_shm_read(gps_data_t*)': libgps_shm.c:122:12: error: no match for 'operator=' (operand types are 'gps_data_t' and 'volatile gps_data_t') noclobber = shared->gpsdata; ^ libgps_shm.c:122:12: note: candidate is: In file included from gpsd.h:350:0, from libgps_shm.c:30: gps.h:1918:8: note: gps_data_t& gps_data_t::operator=(const gps_data_t&) struct gps_data_t { ^ gps.h:1918:8: note: no known conversion for argument 1 from 'volatile gps_data_t' to 'const gps_data_t&'
* Copy structs using assignment, not memcpy().Zbigniew Chyla2015-04-281-6/+2
|
* Retire splint from our set of static analyzers.Eric S. Raymond2015-03-301-8/+2
| | | | | | | | | | | | | | | | | | | The proximate cause was that we've been seing emission of error messages that were randomly and disturbingly variable across different environments - notably Raspbian and Gentoo splint gave nontrivially different results than Ubuntu 14.10 splint. And this was *not* due to Ubuntu patches! A pristine splint built from the 3.1.2 tarball on Ubuntu didn't match the Raspbian and Gentoo results either. But this has been coming for a while. Easy access to more modern static analyzers such as coverity, scan-build and cppcheck has been decreasing the utility of splint, which is unmaintained and somewhat buggy and not easy to use. Only file not cleaned is ppsthread.c, because Gary has been working on it during this cleanup. All regression tests pass. PPS observed live on GR601-W.
* Clean up most spint errors. All regression tests pass.Eric S. Raymond2015-03-281-1/+1
|
* Yet more: Line expects to suppress X error, found 0 errorsGary E. Miller2015-03-251-1/+1
|
* remove extraneous semicolonGary E. Miller2015-03-131-1/+1
|
* splint/cppcheck/coverity prerelease cleanup.Eric S. Raymond2015-03-131-1/+1
|
* Document SHM and JSON timeout is in uSec. Fix SHM so that is true.Gary E. Miller2015-03-121-2/+3
| | | | | JSON wait was in uSec, but SHM wait was in Sec. Made both uSec and documented three places.
* OS X needs a lot of time.hGary E. Miller2015-03-081-0/+1
| | | | | | gpsd_config.h needs time_t which is in time.h OS X builds now. Untested.
* Insert memory barriers in libgps_shm_waiting().Eric S. Raymond2015-03-061-4/+8
| | | | | | Also, make sure it reurns false on timeout. All regression tests pass.
* Comment and documentation polishing.Eric S. Raymond2015-03-061-1/+1
|
* Repair the logic for setting a non-default SHM export segment.Eric S. Raymond2015-02-161-1/+1
| | | | | | Also, ensure this always happens within the regression-test driver. All regression tests pass.
* Instrument shm segment creation a bit better.Eric S. Raymond2015-02-111-2/+4
| | | | All regression tests pass.
* BSD compiler waening and splint cleanup.Eric S. Raymond2015-02-111-0/+2
|
* Implement and document GPSD_SHM_KEY environment variable.Eric S. Raymond2015-02-091-2/+2
|
* First part of Android port patches: deal with in_port_t. SUN_LEN, and getsid().Eric S. Raymond2014-08-181-2/+4
| | | | | | | | | Also, fix how configuratuin in libgps_shm.c and smexport.h is handled. Based on a patch by Samuel Cuella <samuel.cuella@supinfo.com>, but cleaned up some to obey local conventions better. All regression tests pass.
* Clarifying name change. All regression test pass. PPS is live.Eric S. Raymond2013-11-061-7/+7
|
* Full splint cleanup. Partial cppcheck cleanup.Eric S. Raymond2013-11-051-2/+1
|
* Fix hang bug in the SHM client code. Thanks to Michael Tatarinov.Eric S. Raymond2013-11-011-2/+2
| | | | This has been broken for two years and nobody noticed!
* Nuke trailing whitespace in C source.Eric S. Raymond2012-09-071-9/+9
|
* The shm export gets a waiting method.Eric S. Raymond2011-10-031-10/+23
|
* First cut at implementing waiting test for shm export.Eric S. Raymond2011-10-031-0/+14
| | | | Timeout argument is presently ignored.
* Remove duplicate code.Michael Tatarinov2011-09-301-1/+0
| | | | Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
* Magic-number elimination.Eric S. Raymond2011-09-301-2/+2
| | | | All three exports work.
* Re-do runtime dispatch in the client library.Eric S. Raymond2011-09-301-2/+0
|
* splint cleanup.Eric S. Raymond2011-09-281-0/+2
|
* Avoid a name collision.Eric S. Raymond2011-09-281-2/+2
|
* First step in runtime export dispatch for the client library.Eric S. Raymond2011-09-281-4/+18
|
* splint cleanup.Eric S. Raymond2011-09-281-1/+1
|
* Break out prototypes for client library export methgods into a new heasder.Eric S. Raymond2011-09-281-0/+1
| | | | All regression tests pass. All three exports work in gpxlogger.
* Abstract out the shm export main loop.Eric S. Raymond2011-09-281-0/+15
|
* Get back to a state where the shm export works.Eric S. Raymond2011-09-271-25/+0
|
* More API convergence.Eric S. Raymond2011-09-271-2/+1
|
* Converge the library APIs for different transports more closely.Eric S. Raymond2011-09-271-0/+26
|
* Comment fix.Eric S. Raymond2011-06-301-2/+2
|