1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

tests: not redirect strderr to stdout

Errors are 'wanted' and expected in this case.
This commit is contained in:
Zdenek Kabelac 2016-09-13 11:55:08 +02:00
parent a156fc9a54
commit 5314d36f3d

View File

@ -72,9 +72,12 @@ int main(int args, char **argv) {
fprintf(stderr, "Could not fork\n");
return FAILURE;
} else if (pid == 0) { /* child */
if (!strcmp(argv[0], "not"))
if (!strcmp(argv[0], "not")) {
val = ">1";
else if (!strcmp(argv[0], "invalid"))
/* Redirect 'expected' error output */
fflush(stderr);
dup2(fileno(stdout), fileno(stderr));
} else if (!strcmp(argv[0], "invalid"))
val = "3";
else if (!strcmp(argv[0], "fail"))
val = "5";