Hi,

I just wanted to contact the developers of GGI to propose this change.
I made the following change to the dlptlock.c routines ggLock and
ggUnlock to avoid a SEG fault  in the version of Descent 2 I'm working
on for Linux:

// [CCA 06-25-00]
// The following change was made to make the operation 'robust'
//
int ggLock(void *lock)
{
  if ((lock != NULL) && (my_lock((pthread_mutex_t*)lock) == 0))
  {
    return 0;
  }
  return GGI_EUNKNOWN;
}

// [CCA 06-25-00]
// The following change was made to make the operation 'robust'
//
int ggUnlock(void *lock)
{
  if ((lock != NULL) && (my_unlock((pthread_mutex_t*)lock) == 0))
  {
    return 0;
  }

  return GGI_EUNKNOWN;
}

While the behavior is different, since both routines have a way to
express the "failure" with the mutex that avoids the SEGMENTATION fault,
it seemed like a good way to fix this problem. If I can find the cause
of the "lock" pointer being NULL, I'll fix that. But in the meantime ....

What do you think of this change?

Thanks

Chris Arena
Virginia Beach, VA
 
 

Reply via email to