VIR_FORCE_CLOSE(fd)
/**
- * virCommandPassFDIndex:
+ * virCommandPassFD:
* @cmd: the command to modify
* @fd: fd to reassign to the child
* @flags: extra flags; binary-OR of virCommandPassFDFlags
- * @idx: pointer to fill with the index of the FD in the transfer set
*
* Transfer the specified file descriptor to the child, instead
* of closing it on exec. @fd must not be one of the three
* should cease using the @fd when this call completes
*/
void
-virCommandPassFDIndex(virCommand *cmd, int fd, unsigned int flags, size_t *idx)
+virCommandPassFD(virCommand *cmd, int fd, unsigned int flags)
{
if (!cmd) {
VIR_COMMAND_MAYBE_CLOSE_FD(fd, flags);
}
virCommandFDSet(cmd, fd, flags);
-
- if (idx)
- *idx = cmd->npassfd - 1;
-}
-
-/**
- * virCommandPassFD:
- * @cmd: the command to modify
- * @fd: fd to reassign to the child
- * @flags: extra flags; binary-OR of virCommandPassFDFlags
- *
- * Transfer the specified file descriptor to the child, instead
- * of closing it on exec. @fd must not be one of the three
- * standard streams.
- *
- * If the flag VIR_COMMAND_PASS_FD_CLOSE_PARENT is set then fd will
- * be closed in the parent no later than Run/RunAsync/Free. The parent
- * should cease using the @fd when this call completes
- */
-void
-virCommandPassFD(virCommand *cmd, int fd, unsigned int flags)
-{
- virCommandPassFDIndex(cmd, fd, flags, NULL);
}
/**
int fd,
unsigned int flags) G_GNUC_NO_INLINE;
-void virCommandPassFDIndex(virCommand *cmd,
- int fd,
- unsigned int flags,
- size_t *idx) G_GNUC_NO_INLINE;
-
void virCommandSetPidFile(virCommand *cmd,
const char *pidfile) ATTRIBUTE_NONNULL(2);