Sleep for 1 second if the child hasn't returned yet before starting the
authormgriego <mgriego>
Sat, 30 Sep 2006 22:21:56 +0000 (22:21 +0000)
committermgriego <mgriego>
Sat, 30 Sep 2006 22:21:56 +0000 (22:21 +0000)
next iteration of the loop.

src/main/exec.c

index 9bacfe4..42d6f4e 100644 (file)
@@ -492,6 +492,11 @@ int radius_exec_program(const char *cmd, REQUEST *request,
                        radlog(L_ERR|L_CONS, "Exec-Program: Failed to catch child return code");
                        return 2;
                }
+               /*
+                *      If we haven't returned yet, the chile hasn't finished,
+                *      so sleep for 1 second then try again.
+                */
+               sleep(1);
        }
 
        radlog(L_ERR|L_CONS, "Exec-Program: Child execution is taking too long.  Giving up.");