~ubuntu-branches/ubuntu/wily/ruby-passenger/wily-proposed

« back to all changes in this revision

Viewing changes to ext/oxt/system_calls.cpp

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2013-11-23 23:50:02 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20131123235002-8fdhsq7afj15o2z2
Tags: 4.0.25-1
* New upstream release.
* Refresh fix_install_path.patch.
* Build for Ruby 2.0 instead of 1.8. (Closes: #725591)
* Add fix_ftbfs_fortify_source.patch.
* Install passenger template files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
 
73
73
void
74
74
oxt::setup_random_failure_simulation(const ErrorChance *_errorChances, unsigned int n) {
 
75
        if (n > OXT_MAX_ERROR_CHANCES) {
 
76
                throw std::runtime_error("Number of error chances may not exceed OXT_MAX_ERROR_CHANCES");
 
77
        }
 
78
 
75
79
        ErrorChance *storage = new ErrorChance[n];
76
80
        for (unsigned int i = 0; i < n; i++) {
77
81
                storage[i] = _errorChances[i];
84
88
shouldSimulateFailure() {
85
89
        if (nErrorChances > 0) {
86
90
                double number = random() / (double) RAND_MAX;
87
 
                const ErrorChance *candidates[nErrorChances];
 
91
                const ErrorChance *candidates[OXT_MAX_ERROR_CHANCES];
88
92
                unsigned int i, n = 0;
89
93
 
90
94
                for (i = 0; i < nErrorChances; i++) {