Imported Upstream version 3.0.4
[debian/gnuradio] / gnuradio-core / src / lib / runtime / gr_vmcircbuf_sysv_shm.cc
index fe0322f7348c70641acf288052b1b01055c78f9b..88869dc755251e2160473dcd2d22f39de269f3a4 100644 (file)
@@ -6,7 +6,7 @@
  * 
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
  * 
  * GNU Radio is distributed in the hope that it will be useful,
@@ -68,11 +68,13 @@ gr_vmcircbuf_sysv_shm::gr_vmcircbuf_sysv_shm (int size)
 
   if ((shmid2 = shmget (IPC_PRIVATE, 2 * size + 2 * pagesize, IPC_CREAT | 0700)) == -1){
     perror ("gr_vmcircbuf_sysv_shm: shmget (1)");
+    shmctl (shmid_guard, IPC_RMID, 0);
     throw std::runtime_error ("gr_vmcircbuf_sysv_shm");
   }
 
   if ((shmid1 = shmget (IPC_PRIVATE, size, IPC_CREAT | 0700)) == -1){
     perror ("gr_vmcircbuf_sysv_shm: shmget (2)");
+    shmctl (shmid_guard, IPC_RMID, 0);
     shmctl (shmid2, IPC_RMID, 0);
     throw std::runtime_error ("gr_vmcircbuf_sysv_shm");
   }