iexec: wait until executability

This commit is contained in:
Přemysl Eric Janouch 2017-07-18 23:06:13 +02:00
parent 5c46d82954
commit 902b06e84c
Signed by: p
GPG Key ID: B715679E3A361BE6
1 changed files with 7 additions and 2 deletions

View File

@ -52,10 +52,15 @@ spawn (char *argv[])
{ {
if ((g_child = fork ()) == -1) if ((g_child = fork ()) == -1)
exit_fatal ("fork: %s", strerror (errno)); 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); execvp (argv[0], argv);
exit_fatal ("execvp: %s", strerror (errno)); print_error ("execvp: %s", strerror (errno));
sleep (1);
} }
} }