From 902b06e84cfce7a301aad01fba147a739940a2e3 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Tue, 18 Jul 2017 23:06:13 +0200
Subject: iexec: wait until executability
---
iexec.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/iexec.c b/iexec.c
index a05e1df..1811b2c 100644
--- a/iexec.c
+++ b/iexec.c
@@ -52,10 +52,15 @@ spawn (char *argv[])
{
if ((g_child = fork ()) == -1)
exit_fatal ("fork: %s", strerror (errno));
- else if (!g_child)
+ else if (g_child)
+ return;
+
+ // A linker can create spurious CLOSE_WRITEs, wait until it's executable
+ while (1)
{
execvp (argv[0], argv);
- exit_fatal ("execvp: %s", strerror (errno));
+ print_error ("execvp: %s", strerror (errno));
+ sleep (1);
}
}
--
cgit v1.2.3-70-g09d2