Changeset 20919

Show
Ignore:
Timestamp:
11/12/07 12:01:04 (1 year ago)
Author:
patrick
Message:

Merges from the trunk:

r20915: Use the symbolic form of the file permissions value for named

semaphores.

r20917: Reset errno to 0 before calling sem_open(3). For some reason, this

seems to be critical for ensuring that sem_open(3) behaves
correctly on Darwin 9.x (Mac OS X 10.5).

Submitted by: Doug McCorkle? <mccdo at iastate dot edu>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • juggler/branches/2.2/modules/vapor/vpr/md/POSIX/Sync/SemaphorePosix.cpp

    r20910 r20919  
    6363   mSemaFile = mktemp(strdup("/tmp/vprsema.XXXXXX")); 
    6464 
     65   // Reset the errno global variable because mktemp(3) should not have failed. 
     66   // This seems to be critical for getting proper behavior out of sem_open(3) 
     67   // on Darwin 9.x (Mac OS X 10.5). 
     68   errno = 0; 
     69 
    6570   // ----- Allocate the named semaphore ----- // 
    66    mSema = sem_open(mSemaFile, O_CREAT, 0600, initialValue); 
     71   // This sets the semaphore file permissions to 0600. 
     72   mSema = sem_open(mSemaFile, O_CREAT, S_IRUSR | S_IWUSR, initialValue); 
    6773 
    6874   if ( mSema == (sem_t*) SEM_FAILED )