Changeset 17879f4 in rtems
- Timestamp:
- 11/18/99 19:43:13 (24 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 105d7872
- Parents:
- c9ae846
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/posix/src/mqueueunlink.c
rc9ae846 r17879f4 44 44 45 45 status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); 46 47 if ( !status ) 46 if ( status != 0 ) 48 47 set_errno_and_return_minus_one( status ); 49 48 -
c/src/exec/posix/src/semaphorenametoid.c
rc9ae846 r17879f4 21 21 * _POSIX_Semaphore_Name_to_id 22 22 * 23 * XXX 23 * Look up the specified name and attempt to locate the id 24 * for the associated semaphore. 24 25 */ 25 26 … … 31 32 Objects_Name_to_id_errors status; 32 33 33 status = _Objects_Name_to_id( &_POSIX_Semaphore_Information, (char *)name, 0, id ); 34 status = _Objects_Name_to_id( 35 &_POSIX_Semaphore_Information, (char *)name, 0, id ); 34 36 35 if ( status == OBJECTS_SUCCESSFUL ) { 36 return 0; 37 } else { 38 return EINVAL; 39 } 37 if ( status == OBJECTS_SUCCESSFUL ) 38 return 0; 39 40 return EINVAL; 40 41 } 41 42 -
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 } -
c/src/exec/posix/src/semunlink.c
rc9ae846 r17879f4 32 32 33 33 status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 34 35 if ( !status ) 34 if ( status != 0 ) 36 35 set_errno_and_return_minus_one( status ); 37 36 … … 56 55 57 56 the_semaphore->linked = FALSE; 58 57 _POSIX_Semaphore_Namespace_remove( the_semaphore ); 59 58 _POSIX_Semaphore_Delete( the_semaphore ); 60 59 -
cpukit/posix/src/mqueueunlink.c
rc9ae846 r17879f4 44 44 45 45 status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); 46 47 if ( !status ) 46 if ( status != 0 ) 48 47 set_errno_and_return_minus_one( status ); 49 48 -
cpukit/posix/src/semaphorenametoid.c
rc9ae846 r17879f4 21 21 * _POSIX_Semaphore_Name_to_id 22 22 * 23 * XXX 23 * Look up the specified name and attempt to locate the id 24 * for the associated semaphore. 24 25 */ 25 26 … … 31 32 Objects_Name_to_id_errors status; 32 33 33 status = _Objects_Name_to_id( &_POSIX_Semaphore_Information, (char *)name, 0, id ); 34 status = _Objects_Name_to_id( 35 &_POSIX_Semaphore_Information, (char *)name, 0, id ); 34 36 35 if ( status == OBJECTS_SUCCESSFUL ) { 36 return 0; 37 } else { 38 return EINVAL; 39 } 37 if ( status == OBJECTS_SUCCESSFUL ) 38 return 0; 39 40 return EINVAL; 40 41 } 41 42 -
cpukit/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 } -
cpukit/posix/src/semunlink.c
rc9ae846 r17879f4 32 32 33 33 status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 34 35 if ( !status ) 34 if ( status != 0 ) 36 35 set_errno_and_return_minus_one( status ); 37 36 … … 56 55 57 56 the_semaphore->linked = FALSE; 58 57 _POSIX_Semaphore_Namespace_remove( the_semaphore ); 59 58 _POSIX_Semaphore_Delete( the_semaphore ); 60 59
Note: See TracChangeset
for help on using the changeset viewer.