This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Lock pairs into the candidate graph in order, without creating cycles | |
void lock_pairs(void) | |
{ | |
int i, j, row, win, los, cycle; | |
for (i = 0; i < pair_count; i++) | |
{ | |
win = pairs[i].winner; | |
los = row = pairs[i].loser; | |
cycle = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changes the behavior of the return code of a pipeline, which is normally the exit status of the last command in the pipe. | |
With `set -o pipefail`, the return code of a pipeline is the value of the last command that failed, or zero if all commands succeeded. | |
This maeks it possible to detect and handle errors that occur in any part of the pipe, not just the end. | |
E.g., suppose we have a script that uses the following pipeline: | |
$ cat file.txt | grep "foo" | wc -l | |
This pipeline counts the number of lines in 'file.txt' that contain the word 'foo'. If 'file.txt' does not exist, the `cat` command will | |
fail and print an error message, but the pipeline will still return zero, because the `wc -l` command succeeds. This means that the | |
script will not be aware of the failure and will continue as if nothing went wrong. |