From: Daniel P. Berrangé Date: Mon, 21 Sep 2020 17:37:03 +0000 (+0100) Subject: tests: avoid close of bad file handle in commandtest X-Git-Tag: v6.8.0-rc1~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faf76dd70e96e43478b3fe02106afa62eeb65dc8;p=thirdparty%2Flibvirt.git tests: avoid close of bad file handle in commandtest Closed file handles need to be initialized to -1, not 0. This caused a inappropriate double close of stdin, which is not desirable, although it had no ill effects. Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrangé --- diff --git a/tests/commandtest.c b/tests/commandtest.c index 42225a8ef2..cbbcda4e5f 100644 --- a/tests/commandtest.c +++ b/tests/commandtest.c @@ -1091,8 +1091,8 @@ static int test27(const void *unused G_GNUC_UNUSED) printf("Could not set send buffers\n"); goto cleanup; } - pipe1[1] = 0; - pipe2[1] = 0; + pipe1[1] = -1; + pipe2[1] = -1; buffer1 = NULL; buffer2 = NULL;