summaryrefslogtreecommitdiff
path: root/libgps_core.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-03-29 18:40:26 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-03-29 18:40:26 -0400
commiteb28dd82c781daf30b5c260af577c5248ea7ddd8 (patch)
treec815765abd5614e48559dc2ae84fb52dac751c09 /libgps_core.c
parent35ae6b77fac58f9c62cb92cfcccfaa41bddd7091 (diff)
downloadgpsd-eb28dd82c781daf30b5c260af577c5248ea7ddd8.tar.gz
Allow gps_errstr() to report shm-specific errors.
Diffstat (limited to 'libgps_core.c')
-rw-r--r--libgps_core.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libgps_core.c b/libgps_core.c
index 0224a075..243c4f86 100644
--- a/libgps_core.c
+++ b/libgps_core.c
@@ -1,4 +1,6 @@
-/* libgps.c -- client interface library for the gpsd daemon
+/* libgps_core.c -- client interface library for the gpsd daemon
+ *
+ * Core portion of client library. Cals helpers to handle different eports.
*
* This file is Copyright (c) 2010 by the GPSD project
* BSD terms apply: see the file COPYING in the distribution root for details.
@@ -141,6 +143,12 @@ extern const char /*@observer@*/ *gps_errstr(const int err)
* protocol compatibility checks
*/
#ifndef USE_QT
+#ifdef SHM_EXPORT_ENABLE
+ if (err == SHM_NOSHARED)
+ return "no shared-memory segment or daemon not running";
+ else if (err == SHM_NOATTACH)
+ return "attach failed for unknown reason";
+#endif /* SHM_EXPORT_ENABLE */
return netlib_errstr(err);
#else
static char buf[32];
@@ -157,7 +165,7 @@ void libgps_dump_state(struct gps_data_t *collect)
/* no need to dump the entire state, this is a sanity check */
#ifndef USE_QT
- /* will fail on a 32-bit macine */
+ /* will fail on a 32-bit machine */
(void)fprintf(debugfp, "flags: (0x%04x) %s\n",
(unsigned int)collect->set, gps_maskdump(collect->set));
#endif