Re: [PATCH 2/3] task-utils: Fix comparison between pointer and integer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 5.11.18 г. 21:06 ч., Rosen Penev wrote:
> pthread_t is a pointer type, not an integer one. The > 0 makes no sense
> and throws a warning.

Code-wise the patch is ok, however, technically pthread_t is an opaque
type. I guess David could fix it on the way in so no need to resend.

Reviewed-by: Nikolay Borisov <nborisov@xxxxxxxx>

> 
> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
> ---
>  task-utils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/task-utils.c b/task-utils.c
> index a9bee8f..e4dcd36 100644
> --- a/task-utils.c
> +++ b/task-utils.c
> @@ -67,7 +67,7 @@ void task_stop(struct task_info *info)
>  	if (!info)
>  		return;
>  
> -	if (info->id > 0) {
> +	if (info->id) {
>  		pthread_cancel(info->id);
>  		pthread_join(info->id, NULL);
>  		info->id = 0;
> 



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux