Skip to content

Commit

Permalink
fs-randomfail: Set fs error always when injecting failure.
Browse files Browse the repository at this point in the history
It was done in some places, but not everywhere.
  • Loading branch information
sirainen committed May 12, 2016
1 parent ebf2e93 commit a80011b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib-fs/fs-randomfail.c
Expand Up @@ -260,7 +260,11 @@ static bool fs_random_fail(struct fs *_fs, enum fs_op op)

if (fs->op_probability[op] == 0)
return FALSE;
return (unsigned int)(rand() % 100) <= fs->op_probability[op];
if ((unsigned int)(rand() % 100) <= fs->op_probability[op]) {
fs_set_error(_fs, RANDOMFAIL_ERROR);
return TRUE;
}
return FALSE;
}

static bool
Expand Down

0 comments on commit a80011b

Please sign in to comment.