mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
tests: Avoid possible error in testExecRestart
If the dup2 fails, then we aren't going to get the correct result. Found by Coverity Signed-off-by: John Ferlan <jferlan@redhat.com> ACKed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
6ae4f4a4ce
commit
c8a4a02058
@ -287,10 +287,13 @@ static int testExecRestart(const void *opaque)
|
|||||||
* fds 100->103 for something else, which is probably
|
* fds 100->103 for something else, which is probably
|
||||||
* fairly reasonable in general
|
* fairly reasonable in general
|
||||||
*/
|
*/
|
||||||
dup2(fdserver[0], 100);
|
if (dup2(fdserver[0], 100) < 0 ||
|
||||||
dup2(fdserver[1], 101);
|
dup2(fdserver[1], 101) < 0 ||
|
||||||
dup2(fdclient[0], 102);
|
dup2(fdclient[0], 102) < 0 ||
|
||||||
dup2(fdclient[1], 103);
|
dup2(fdclient[1], 103) < 0) {
|
||||||
|
virReportSystemError(errno, "%s", "dup2() failed");
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
if (virAsprintf(&infile, "%s/virnetdaemondata/input-data-%s.json",
|
if (virAsprintf(&infile, "%s/virnetdaemondata/input-data-%s.json",
|
||||||
abs_srcdir, data->jsonfile) < 0)
|
abs_srcdir, data->jsonfile) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user