This is an automated email from the ASF dual-hosted git repository. aboda pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
The following commit(s) were added to refs/heads/master by this push: new ca35388 MINIFICPP-1221 - Cannot attach to running MiNiFi process. ca35388 is described below commit ca3538886e075918730846bf9753abffd8c83503 Author: Adam Debreceni <adam.debrec...@protonmail.com> AuthorDate: Wed May 13 11:20:43 2020 +0200 MINIFICPP-1221 - Cannot attach to running MiNiFi process. Signed-off-by: Arpad Boda <ab...@apache.org> This closes #783 --- main/MiNiFiMain.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/main/MiNiFiMain.cpp b/main/MiNiFiMain.cpp index 465ed34..b3205d5 100644 --- a/main/MiNiFiMain.cpp +++ b/main/MiNiFiMain.cpp @@ -315,14 +315,15 @@ int main(int argc, char **argv) { * yield without the need for a more complex construct and * a spin lock */ - if (sem_wait(running) == -1) - perror("sem_wait"); + int ret_val; + while ((ret_val = sem_wait(running)) == -1 && errno == EINTR); + if(ret_val == -1) perror("sem_wait"); - if (sem_close(running) == -1) - perror("sem_close"); + while ((ret_val = sem_close(running)) == -1 && errno == EINTR); + if(ret_val == -1) perror("sem_close"); - if (sem_unlink("/MiNiFiMain") == -1) - perror("sem_unlink"); + while ((ret_val = sem_unlink("/MiNiFiMain")) == -1 && errno == EINTR); + if(ret_val == -1) perror("sem_unlink"); /** * Trigger unload -- wait stop_wait_time