Changeset 17879f4 in rtems for c/src/exec/posix/src/semopen.c
- Timestamp:
- Nov 18, 1999, 7:43:13 PM (21 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 105d7872
- Parents:
- c9ae846
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/posix/src/semopen.c
rc9ae846 r17879f4 44 44 if ( oflag & O_CREAT ) { 45 45 va_start(arg, oflag); 46 /*mode = (mode_t) va_arg( arg, mode_t * );*/47 46 mode = va_arg( arg, mode_t ); 48 /*value = (unsigned int) va_arg( arg, unsigned int * );*/49 47 value = va_arg( arg, unsigned int ); 50 48 va_end(arg); … … 62 60 if ( status ) { 63 61 64 if ( status == EINVAL ) { /* name -> ID translation failed */ 65 if ( !(oflag & O_CREAT) ) { /* willing to create it? */ 62 /* 63 * Unless we are willing to create name -> ID translation failure is 64 * an error. 65 */ 66 67 if ( status == EINVAL ) { 68 if ( !(oflag & O_CREAT) ) { 66 69 set_errno_and_return_minus_one_cast( ENOENT, sem_t * ); 67 70 } 68 /* we are willing to create it */69 71 } 70 /* some type of error */71 /*set_errno_and_return_minus_one_cast( status, sem_t * );*/72 72 73 } else { /* name -> ID translation succeeded */ 73 } else { 74 75 /* 76 * Check for existence with creation. 77 */ 74 78 75 79 if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { … … 77 81 } 78 82 79 /*80 * XXX In this case we need to do an ID->pointer conversion to81 * check the mode. This is probably a good place for a subroutine.82 */83 84 83 the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); 85 84 the_semaphore->open_count += 1; 86 87 85 return (sem_t *)&the_semaphore->Object.id; 88 86 89 87 } 90 88 91 /* XXX verify this comment... 92 * 89 /* 93 90 * At this point, the semaphore does not exist and everything has been 94 91 * checked. We should go ahead and create a semaphore. … … 102 99 ); 103 100 101 /* 102 * errno was set by Create_support, so don't set it again. 103 */ 104 104 105 if ( status == -1 ) 105 return (sem_t *) -1;106 return SEM_FAILED; 106 107 107 108 return (sem_t *) &the_semaphore->Object.id; 108 109 109 }
Note: See TracChangeset
for help on using the changeset viewer.