Thread (47 messages) flat view 47 messages, 3 authors, 2016-06-15

Re: [PATCH v2 05/14] mingw: support waitpid with pid > 0 and WNOHANG

From: Erik Faye-Lund <hidden>
Date: 2016-06-15 22:48:02

On Fri, Jan 15, 2010 at 11:28 PM, Johannes Sixt [off-list ref] wrote:
On Freitag, 15. Januar 2010, Erik Faye-Lund wrote:
quoted
 static inline int waitpid(pid_t pid, int *status, unsigned options)
 {
+     if (pid > 0 && options & WNOHANG) {
+             if (WAIT_OBJECT_0 != WaitForSingleObject((HANDLE)pid, 0))
+                     return 0;
+             options &= ~WNOHANG;
+     }
+
      if (options == 0)
              return _cwait(status, pid, 0);
      errno = EINVAL;
With this change, and in particular the one in the next patch, this function
grows too large to be 'static inline'.

-- Hannes
Fixed locally.

-- 
Erik "kusma" Faye-Lund
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help