Mercurial > dovecot > original-hg > dovecot-1.2
comparison src/auth/mech-winbind.c @ 6230:5cf1c1ae7dd8 HEAD
waitpid() fix
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 07 Aug 2007 15:09:26 +0300 |
parents | 0b4ec1687f3c |
children | 616872f3710c |
comparison
equal
deleted
inserted
replaced
6229:ad1b948c5fa2 | 6230:5cf1c1ae7dd8 |
---|---|
60 o_stream_destroy(&winbind->out_pipe); | 60 o_stream_destroy(&winbind->out_pipe); |
61 } | 61 } |
62 | 62 |
63 static void winbind_wait_pid(struct winbind_helper *winbind) | 63 static void winbind_wait_pid(struct winbind_helper *winbind) |
64 { | 64 { |
65 int status; | 65 int status, ret; |
66 | 66 |
67 if (winbind->pid == -1) | 67 if (winbind->pid == -1) |
68 return; | 68 return; |
69 | 69 |
70 if (waitpid(winbind->pid, &status, WNOHANG) == -1) { | 70 if ((ret = waitpid(winbind->pid, &status, WNOHANG)) <= 0) { |
71 if (errno != ECHILD && errno != EINTR) | 71 if (ret < 0 && errno != ECHILD && errno != EINTR) |
72 i_error("waitpid() failed: %m"); | 72 i_error("waitpid() failed: %m"); |
73 return; | 73 return; |
74 } | 74 } |
75 | 75 |
76 if (WIFSIGNALED(status)) { | 76 if (WIFSIGNALED(status)) { |