summaryrefslogtreecommitdiff
path: root/ntpshm.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2011-03-21 19:06:26 -0400
committerEric S. Raymond <esr@thyrsus.com>2011-03-21 19:06:26 -0400
commitdd756c9798dddb0b1604776e5f69bce975c23a86 (patch)
treef4e27ff524a0be28602fdfd15f726fb60f525412 /ntpshm.c
parent82c5bd422dca07ed949707d48268389b1bf72184 (diff)
downloadgpsd-dd756c9798dddb0b1604776e5f69bce975c23a86.tar.gz
Move a declaration so it doesn't follow executable code.
Diffstat (limited to 'ntpshm.c')
-rw-r--r--ntpshm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ntpshm.c b/ntpshm.c
index 2bcd36ea..7344d67d 100644
--- a/ntpshm.c
+++ b/ntpshm.c
@@ -109,6 +109,7 @@ static /*@null@*/ volatile struct shmTime *getShmTime(int unit)
{
int shmid;
unsigned int perms;
+ volatile struct shmTime *p;
// set the SHM perms the way ntpd does
if (unit < 2) {
// we are root, be careful
@@ -126,7 +127,7 @@ static /*@null@*/ volatile struct shmTime *getShmTime(int unit)
(int)perms, strerror(errno));
return NULL;
}
- volatile struct shmTime *p = (struct shmTime *)shmat(shmid, 0, 0);
+ p = (struct shmTime *)shmat(shmid, 0, 0);
/*@ -mustfreefresh */
if ((int)(long)p == -1) {
gpsd_report(LOG_ERROR, "NTPD shmat failed: %s\n",