io: Introduce qio_channel_file_new_dupfd
authorFabiano Rosas <farosas@suse.de>
Mon, 11 Mar 2024 23:33:34 +0000 (20:33 -0300)
committerPeter Xu <peterx@redhat.com>
Tue, 12 Mar 2024 19:22:23 +0000 (15:22 -0400)
commit4760cedc61328e47bf7f1fabceb9937facfa4cdd
tree6eef4197a0c83d12afca866005569787b03106f4
parent35ac6831d98e18e2c78c85c93e3a6ca1f1ae3e58
io: Introduce qio_channel_file_new_dupfd

Add a new helper function for creating a QIOChannelFile channel with a
duplicated file descriptor. This saves the calling code from having to
do error checking on the dup() call.

Suggested-by: "Daniel P. Berrangé" <berrange@redhat.com>
Signed-off-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: "Daniel P. Berrangé" <berrange@redhat.com>
Link: https://lore.kernel.org/r/20240311233335.17299-2-farosas@suse.de
Signed-off-by: Peter Xu <peterx@redhat.com>
include/io/channel-file.h
io/channel-file.c