Changeset 27312 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Mar 12, 2010 2:24:03 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/pipe-posix.cpp
r26824 r27312 113 113 if (RT_SUCCESS(rc)) 114 114 { 115 /* 116 * Create the two handles. 117 */ 118 RTPIPEINTERNAL *pThisR = (RTPIPEINTERNAL *)RTMemAlloc(sizeof(RTPIPEINTERNAL)); 119 if (pThisR) 120 { 121 RTPIPEINTERNAL *pThisW = (RTPIPEINTERNAL *)RTMemAlloc(sizeof(RTPIPEINTERNAL)); 122 if (pThisW) 123 { 124 pThisR->u32Magic = RTPIPE_MAGIC; 125 pThisW->u32Magic = RTPIPE_MAGIC; 126 pThisR->fd = aFds[0]; 127 pThisW->fd = aFds[1]; 128 pThisR->fRead = true; 129 pThisW->fRead = false; 130 pThisR->u32State = RTPIPE_POSIX_BLOCKING; 131 pThisW->u32State = RTPIPE_POSIX_BLOCKING; 132 133 *phPipeRead = pThisR; 134 *phPipeWrite = pThisW; 135 136 /* 137 * Before we leave, make sure to shut up SIGPIPE. 138 */ 139 signal(SIGPIPE, SIG_IGN); 140 return VINF_SUCCESS; 141 } 142 143 RTMemFree(pThisR); 144 } 115 /* 116 * Create the two handles. 117 */ 118 RTPIPEINTERNAL *pThisR = (RTPIPEINTERNAL *)RTMemAlloc(sizeof(RTPIPEINTERNAL)); 119 if (pThisR) 120 { 121 RTPIPEINTERNAL *pThisW = (RTPIPEINTERNAL *)RTMemAlloc(sizeof(RTPIPEINTERNAL)); 122 if (pThisW) 123 { 124 pThisR->u32Magic = RTPIPE_MAGIC; 125 pThisW->u32Magic = RTPIPE_MAGIC; 126 pThisR->fd = aFds[0]; 127 pThisW->fd = aFds[1]; 128 pThisR->fRead = true; 129 pThisW->fRead = false; 130 pThisR->u32State = RTPIPE_POSIX_BLOCKING; 131 pThisW->u32State = RTPIPE_POSIX_BLOCKING; 132 133 *phPipeRead = pThisR; 134 *phPipeWrite = pThisW; 135 136 /* 137 * Before we leave, make sure to shut up SIGPIPE. 138 */ 139 signal(SIGPIPE, SIG_IGN); 140 return VINF_SUCCESS; 141 } 142 143 RTMemFree(pThisR); 144 rc = VERR_NO_MEMORY; 145 } 146 else 147 rc = VERR_NO_MEMORY; 145 148 } 146 149 … … 433 436 else if (errno == EAGAIN) 434 437 { 435 *pcbWritten = 0; ;438 *pcbWritten = 0; 436 439 rc = VINF_TRY_AGAIN; 437 440 }
Note:
See TracChangeset
for help on using the changeset viewer.