unsigned retry_count = 5; do { err = action (); } while (err && is_transient_error (err) && retry_count-- && (sleep (), TRUE)) return err;