mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
Merge virCommandPreserveFD / virCommandTransferFD
Merge the virCommandPreserveFD / virCommandTransferFD methods into a single virCommandPasFD method, and use a new VIR_COMMAND_PASS_FD_CLOSE_PARENT to indicate their difference in behaviour Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
@@ -258,8 +258,9 @@
|
||||
<pre>
|
||||
int sharedfd = open("cmd.log", "w+");
|
||||
int childfd = open("conf.txt", "r");
|
||||
virCommandPreserveFD(cmd, sharedfd);
|
||||
virCommandTransferFD(cmd, childfd);
|
||||
virCommandPassFD(cmd, sharedfd, 0);
|
||||
virCommandPassFD(cmd, childfd,
|
||||
VIR_COMMAND_PASS_FD_CLOSE_PARENT);
|
||||
if (VIR_CLOSE(sharedfd) < 0)
|
||||
goto cleanup;
|
||||
</pre>
|
||||
|
||||
Reference in New Issue
Block a user