]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
refclock_shm.c:
authorHal Murray <murray@ntp.org>
Wed, 28 Oct 2009 17:32:36 +0000 (13:32 -0400)
committerHal Murray <murray@ntp.org>
Wed, 28 Oct 2009 17:32:36 +0000 (13:32 -0400)
  Fix for bug-1357: bogus assert in refclock_shm

bk: 4ae88034qdkalk4qwdZLF8RRBal0PA

ntpd/refclock_shm.c

index 3370ae043d4747cc6ad1873b4de90dc26bf3ca91..d2fe2c584722acd3915ca3e32118bb08d4d99141 100644 (file)
@@ -113,7 +113,10 @@ struct shmTime *getShmTime (int unit) {
 #ifndef SYS_WINNT
        int shmid=0;
 
-       assert (unit<10); /* MAXUNIT is 4, so should never happen */
+       /* 0x4e545030 is NTP0.
+        * Big units will give non-ascii but that's OK
+        * as long as everybody does it the same way. 
+        */
        shmid=shmget (0x4e545030+unit, sizeof (struct shmTime), 
                      IPC_CREAT|(unit<2?0700:0777));
        if (shmid==-1) { /*error */