diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2017-07-18 23:06:13 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2017-07-18 23:06:13 +0200 |
commit | 902b06e84cfce7a301aad01fba147a739940a2e3 (patch) | |
tree | b4da8b9d5d665281bb0abeb41176566d632fa07f | |
parent | 5c46d829541076e3e2adb817cf287bf8c18de724 (diff) | |
download | desktop-tools-902b06e84cfce7a301aad01fba147a739940a2e3.tar.gz desktop-tools-902b06e84cfce7a301aad01fba147a739940a2e3.tar.xz desktop-tools-902b06e84cfce7a301aad01fba147a739940a2e3.zip |
iexec: wait until executability
-rw-r--r-- | iexec.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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); } } |