[PATCH] cygwin: timer_delete: Fix return value

Corinna Vinschen corinna-cygwin@cygwin.com
Tue Oct 22 15:06:13 GMT 2024


Hi Christian,

On Oct 12 18:58, Christian Franke wrote:
> Nobody checks the return value of functions which only free resources:
> close(), ..., timer_delete(), ... :-)

Sigh.  Apparently I broke it in 2019, see commit 229ea3f23c015.

> From 2d0c5b53bba2ded8d85ed725774498cffbb4f1de Mon Sep 17 00:00:00 2001
> From: Christian Franke <christian.franke@t-online.de>
> Date: Sat, 12 Oct 2024 18:47:00 +0200
> Subject: [PATCH] cygwin: timer_delete: Fix return value
> 
> timer_delete() always returned failure.  This issue has been
> detected by 'stress-ng --hrtimers 1'.
> 

Please add

  Fixes: 229ea3f23c015 ("Cygwin: posix timers: reimplement using OS timer")

> Signed-off-by: Christian Franke <christian.franke@t-online.de>
> ---
>  winsup/cygwin/posix_timer.cc | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/winsup/cygwin/posix_timer.cc b/winsup/cygwin/posix_timer.cc
> index 9d832f201..a336b2bc2 100644
> --- a/winsup/cygwin/posix_timer.cc
> +++ b/winsup/cygwin/posix_timer.cc
> @@ -530,6 +530,7 @@ timer_delete (timer_t timerid)
>  	  __leave;
>  	}
>        delete in_tt;
> +      ret = 0;
>      }
>    __except (EFAULT) {}
>    __endtry
> -- 
> 2.45.1
> 

Also add an entry for the release/3.5.5 file, please.


Thanks,
Corinna


More information about the Cygwin-patches mailing list