Text archives Help
- From: abe@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r602 - branches/itanium2/Core/Shm
- Date: Thu, 6 Oct 2005 14:31:24 -0600 (MDT)
Author: abe
Date: Thu Oct 6 14:31:24 2005
New Revision: 602
Modified:
branches/itanium2/Core/Shm/MFStreamData.cc
branches/itanium2/Core/Shm/ShmSemaphore.cc
Log:
Found PERM_FILE flag. Shm image display doesn't crash any more, but the test
program won't run on this version of propack....
M Core/Shm/ShmSemaphore.cc
M Core/Shm/MFStreamData.cc
Modified: branches/itanium2/Core/Shm/MFStreamData.cc
==============================================================================
--- branches/itanium2/Core/Shm/MFStreamData.cc (original)
+++ branches/itanium2/Core/Shm/MFStreamData.cc Thu Oct 6 14:31:24 2005
@@ -38,6 +38,7 @@
#include <Image/Pixel.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <time.h>
@@ -47,18 +48,20 @@
using namespace Manta;
using namespace SCIRun;
+#define PERM_FILE ( S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH |
S_IWOTH )
+
void *MFStreamData::operator new( size_t bytes, int key_, int flag ) {
int id;
// Lookup the shm key.
- if ((id = shmget( key_, sizeof(MFStreamData), 0 /*PERM_FILE*/ )) == -1) {
+ if ((id = shmget( key_, sizeof(MFStreamData), PERM_FILE )) == -1) {
// Check to see if we should create a new segment.
if ((errno == ENOENT) && (flag == STRM_SHM_CREATE)) {
// Try to create again.
- if ((id = shmget( key_, sizeof(MFStreamData), IPC_CREAT/*|PERM_FILE*/
)) == -1) {
+ if ((id = shmget( key_, sizeof(MFStreamData), IPC_CREAT|PERM_FILE ))
== -1) {
throw new ErrnoException( "Cannot create shm: ", errno, __FILE__,
__LINE__ );
}
}
Modified: branches/itanium2/Core/Shm/ShmSemaphore.cc
==============================================================================
--- branches/itanium2/Core/Shm/ShmSemaphore.cc (original)
+++ branches/itanium2/Core/Shm/ShmSemaphore.cc Thu Oct 6 14:31:24 2005
@@ -34,11 +34,14 @@
#include <SCIRun/Core/Exceptions/ErrnoException.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <errno.h>
+#define PERM_FILE ( S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH |
S_IWOTH )
+
using namespace Manta;
using namespace SCIRun;
@@ -52,7 +55,7 @@
arg;
// Create the semaphore.
- id = semget( key_, 1, /*PERM_FILE|*/IPC_CREAT );
+ id = semget( key_, 1, PERM_FILE|IPC_CREAT );
if (id == -1) {
throw new ErrnoException( "Cannot create shm semaphore ", errno,
__FILE__, __LINE__ );
}
- [MANTA] r602 - branches/itanium2/Core/Shm, abe, 10/06/2005
Archive powered by MHonArc 2.6.16.