+ if (WCOREDUMP(status)) {
+ /* Disable further core dumps to save disk space. */
+ struct rlimit r;
+
+ r.rlim_cur = 0;
+ r.rlim_max = 0;
+ if (setrlimit(RLIMIT_CORE, &r) == -1) {
+ VLOG_WARN("failed to disable core dumps: %s",
+ strerror(errno));
+ }
+ }
+
+ /* Throttle restarts to no more than once every 10 seconds. */
+ if (time(NULL) < last_restart + 10) {
+ VLOG_WARN("%s, waiting until 10 seconds since last "
+ "restart", status_msg);
+ for (;;) {
+ time_t now = time(NULL);
+ time_t wakeup = last_restart + 10;
+ if (now >= wakeup) {
+ break;
+ }
+ sleep(wakeup - now);
+ }
+ }
+ last_restart = time(NULL);
+