From a2d71d8b9fa77325d466e47499d3da18c6b17a1f Mon Sep 17 00:00:00 2001 From: LRN Date: Thu, 14 Feb 2013 16:15:07 +0000 Subject: Make pipe ends detachable, fix W32 corner-cases Now pipe ends are fully-functional FileHandles. You can detach them from the pipe, and closing pipe will not affect them afterwards. Tightened W32 implementation (make it close events!) --- src/include/gnunet_disk_lib.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/include/gnunet_disk_lib.h') diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index dd42f9e91..0f36353b0 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h @@ -466,6 +466,22 @@ int GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, enum GNUNET_DISK_PipeEnd end); +/** + * Detaches one of the ends from the pipe. + * Detached end is a fully-functional FileHandle, it will + * not be affected by anything you do with the pipe afterwards. + * Each end of a pipe can only be detched from it once (i.e. + * it is not duplicated). + * + * @param p pipe to detach an end from + * @param end which end of the pipe to detach + * @return Detached end on success, NULL on failure + * (or if that end is not present or is closed). + */ +struct GNUNET_DISK_FileHandle * +GNUNET_DISK_pipe_detach_end (struct GNUNET_DISK_PipeHandle *p, + enum GNUNET_DISK_PipeEnd end); + /** * Close an open file. * -- cgit v1.2.3