[PATCH:xscope 21/24] Refactor fd closing into CloseFD helper function

Mark Kettenis mark.kettenis at xs4all.nl
Sat Sep 1 03:48:31 PDT 2012


> From: Alan Coopersmith <alan.coopersmith at oracle.com>
> Date: Fri, 31 Aug 2012 22:18:03 -0700
> 
> All versions now perform same check for XtransConn data to decide
> whether to use _X11TransClose or regular close, which is needed for
> being able to read data from pre-recorded files instead of live sockets.
> 
> Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>

See comments below.  Otherwise:

Reviewed-by: Mark Kettenis <kettenis at openbsd.org>

> ---
>  fd.c    |   23 +++++++++++++++++------
>  fd.h    |    1 +
>  scope.c |   12 +++---------
>  3 files changed, 21 insertions(+), 15 deletions(-)
> 
> diff --git a/fd.c b/fd.c
> index 7b6accd..176c73e 100644
> --- a/fd.c
> +++ b/fd.c
> @@ -196,20 +196,31 @@ GetXTransConnInfo(FD fd)
>  
>  /* ************************************************************ */
>  
> -static void
> -EOFonFD(FD fd)
> +void
> +CloseFD (FD fd)
>  {

Sure you didn't intend to introduce this style inconsistency of having
a space between the function name and the opening parenthesis?

> diff --git a/fd.h b/fd.h
> index 85cdd25..0a65205 100644
> --- a/fd.h
> +++ b/fd.h
> @@ -87,6 +87,7 @@ extern fd_set BlockedReadDescriptors;   /* bit map of FD's blocked from reading
>  extern int HighestFD;           /* highest FD in use -- for select */
>  
>  extern void InitializeFD(void);
> +extern void CloseFD (FD fd);

Same here.


More information about the xorg-devel mailing list