posix updates#1
Conversation
- fixes open/close etc functions - fixes COND_TIMED_WAIT error value - makes printfs debug only - fixes headers for POSIX - does more error checking on windows methods - fixes param issues on posix - does string length checking for temp paths - adds mq_sendtimed
thehesiod
left a comment
There was a problem hiding this comment.
Comments based on my changes
| { | ||
| SetEvent(hdr->mqh_wait); | ||
| return 0; | ||
| BOOL result = SetEvent(hdr->mqh_wait); |
There was a problem hiding this comment.
SetEvent success is non-zero, however pthread_cond_signal is 0 on success, it should match pthread_cond_signal. Of Interested is that the return value is currently not checked
| return ETIMEDOUT; | ||
| } | ||
|
|
||
| return EINVAL; |
There was a problem hiding this comment.
this method needed to return an error value similar to pthread_cond_timedwait
| strcpy(pathBuffer, temp); | ||
| strcat(pathBuffer, pathPart); | ||
| return 1; | ||
| } |
There was a problem hiding this comment.
This now does error checking on the string length
| /* open and specify O_EXCL and user-execute */ | ||
| oflag &= ~3; // strip off RDONLY, WRONLY or RDWR bits | ||
| fd = _open(pathBuffer, oflag | O_EXCL | O_RDWR, mode | S_IXUSR); | ||
| fd = open(pathBuffer, oflag | O_EXCL | O_RDWR, mode | S_IXUSR); |
There was a problem hiding this comment.
need to keep the names posix compatible
| } | ||
|
|
||
| if(n != 0) { | ||
| errno = n; |
There was a problem hiding this comment.
callers expect the errno to be set
| errno = EMSGSIZE; | ||
| goto err; | ||
| } | ||
|
|
There was a problem hiding this comment.
shouldn't the MUTEX_LOCK above also be timed? If so the same should be done in the timed send
Uh oh!
There was an error while loading. Please reload this page.