summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-10-17 07:27:57 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-10-17 07:27:57 -0400
commitfd48fee4c78f49bab10edb1fd10299296cf2e48a (patch)
treed43ffa61610f0d3bd47a7a52b1f075760e0b5d8f
parent838f38f224c4a6601b25ce62ceb5c3b7c25d3201 (diff)
downloadgpsd-fd48fee4c78f49bab10edb1fd10299296cf2e48a.tar.gz
A volatile that might be helpful, and explanatory comments.
-rw-r--r--ntpshm.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ntpshm.c b/ntpshm.c
index 68b25817..023f7c7b 100644
--- a/ntpshm.c
+++ b/ntpshm.c
@@ -7,7 +7,7 @@
* two PPS delivery methods in play. One, kernel PPS (KPPS), is a Linux-only
* feature supplied through special /dev/pps devices. The other, serial PPS,
* uses the TIOCMIWAIT ioctl to explicitly watch for PPS on serial lines. KPPS
- * requires roor permissions; serial PPS does not.
+ * requires root permissions; serial PPS does not.
*
* This file is Copyright (c) 2010 by the GPSD project
* BSD terms apply: see the file COPYING in the distribution root for details.
@@ -39,7 +39,7 @@
#if defined(HAVE_SYS_TIMEPPS_H)
static pthread_mutex_t initialization_mutex;
-static int uninitialized_pps_thread_count;
+static volatile int uninitialized_pps_thread_count;
#endif /* defined(HAVE_SYS_TIMEPPS_H) */
#define PPS_MAX_OFFSET 100000 /* microseconds the PPS can 'pull' */
@@ -86,7 +86,7 @@ struct shmTime
* for synchronisation.
*
* As gpsd can be started as both root and non-root, this behaviour is
- * mimiced by:
+ * mimicked by:
*
* Started as root: do as ntpd when attaching (creating) the segments.
* (In contrast to ntpd, which only attaches (creates) configured
@@ -103,7 +103,9 @@ struct shmTime
* will be delivered on segments 2 and 3.
*
* to debug, try looking at the live segments this way
+ *
* ipcs -m
+ *
* results should look like this:
* ------ Shared Memory Segments --------
* key shmid owner perms bytes nattch status