Changeset 7fbef786 in rtems for cpukit/posix/src/mqueueopen.c
- Timestamp:
- 12/23/99 22:09:36 (23 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- afebb3f
- Parents:
- 8f12d069
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpukit/posix/src/mqueueopen.c
r8f12d069 r7fbef786 48 48 Objects_Id the_mq_id; 49 49 POSIX_Message_queue_Control *the_mq; 50 Objects_Locations location; 50 51 52 _Thread_Disable_dispatch(); 53 51 54 if ( oflag & O_CREAT ) { 52 55 va_start(arg, oflag); … … 67 70 if ( status ) { 68 71 69 if ( status == EINVAL ) { /* name -> ID translation failed */ 70 if ( !(oflag & O_CREAT) ) { /* willing to create it? */ 71 set_errno_and_return_minus_one( ENOENT ); 72 return (mqd_t) -1; 73 } 74 /* we are willing to create it */ 72 /* 73 * Unless provided a valid name that did not already exist 74 * and we are willing to create then it is an error. 75 */ 76 77 if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { 78 _Thread_Enable_dispatch(); 79 set_errno_and_return_minus_one_cast( status, mqd_t ); 75 80 } 76 set_errno_and_return_minus_one( status ); /* some type of error */ 77 return (mqd_t) -1; 78 81 79 82 } else { /* name -> ID translation succeeded */ 80 83 84 /* 85 * Check for existence with creation. 86 */ 87 81 88 if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 82 set_errno_and_return_minus_one( EEXIST);83 return (mqd_t) -1;89 _Thread_Enable_dispatch(); 90 set_errno_and_return_minus_one_cast( EEXIST, mqd_t ); 84 91 } 85 92 86 93 /* 87 94 * XXX In this case we need to do an ID->pointer conversion to 88 95 * check the mode. This is probably a good place for a subroutine. 89 96 */ 90 97 98 the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); 91 99 the_mq->open_count += 1; 92 93 return (mqd_t)&the_mq->Object.id; 100 _Thread_Enable_dispatch(); 101 _Thread_Enable_dispatch(); 102 return (mqd_t)the_mq->Object.id; 94 103 95 104 } … … 109 118 ); 110 119 120 /* 121 * errno was set by Create_support, so don't set it again. 122 */ 123 124 _Thread_Enable_dispatch(); 125 111 126 if ( status == -1 ) 112 127 return (mqd_t) -1; 113 128 114 return (mqd_t) &the_mq->Object.id;129 return (mqd_t) the_mq->Object.id; 115 130 } 116 131
Note: See TracChangeset
for help on using the changeset viewer.