1From 1ae99b796a2b949dfec91ed75026906e2891192c Mon Sep 17 00:00:00 2001 2From: Jeffy Chen <jeffy.chen@rock-chips.com> 3Date: Tue, 5 Jul 2022 12:49:24 +0800 4Subject: [PATCH 09/10] elput: Fix pipe racing in async_open() 5 6Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> 7--- 8 src/lib/elput/elput_input.c | 5 +++++ 9 1 file changed, 5 insertions(+) 10 11diff --git a/src/lib/elput/elput_input.c b/src/lib/elput/elput_input.c 12index 4005a43..5196353 100644 13--- a/src/lib/elput/elput_input.c 14+++ b/src/lib/elput/elput_input.c 15@@ -76,6 +76,11 @@ _cb_open_restricted(const char *path, int flags, void *data) 16 if (avail < 0) break; 17 } 18 close(p[0]); 19+ 20+ /* Sync with the other side */ 21+ while (em->input.pipe != -1) 22+ usleep(1000); 23+ 24 return ret; 25 } 26 27-- 282.20.1 29 30