CLIENT_WaitReply: don't clear last error on success; fixed callers
accordingly (based on a patch by Juergen Schmied).
diff --git a/scheduler/semaphore.c b/scheduler/semaphore.c
index b321331..298df02 100644
--- a/scheduler/semaphore.c
+++ b/scheduler/semaphore.c
@@ -35,6 +35,7 @@
req.inherit = (sa && (sa->nLength>=sizeof(*sa)) && sa->bInheritHandle);
CLIENT_SendRequest( REQ_CREATE_SEMAPHORE, -1, 2, &req, sizeof(req), name, len );
+ SetLastError(0);
CLIENT_WaitSimpleReply( &reply, sizeof(reply), NULL );
if (reply.handle == -1) return 0;
return reply.handle;