Re: [HACKERS][PATCH] adding simple sock check for windows

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: CharSyam <charsyam(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS][PATCH] adding simple sock check for windows
Date: 2018-03-31 05:38:37
Message-ID: CAA4eK1JDacOZnsXftNMYwTztGe9sMYSci--f-zqmd+bAK=WXZA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 30, 2018 at 8:10 PM, CharSyam <charsyam(at)gmail(dot)com> wrote:
> Hi, I found some missing check for windows int init_slot function in vacuumdb.c
>
> in windows
> SOCKET is unsigned type. so
>
> slot->sock < 0 never can be under 0.
>
> so this patch just check using slot->sock == PGINVALID_SOCKET
>

- if (slot->sock < 0)
+ if (slot->sock == PGINVALID_SOCKET || slot->sock < 0)

If you are checking for PGINVALID_SOCKET, why do you need the second
part of check (slot->sock < 0)?

--
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2018-03-31 05:39:40 Re: WIP: Covering + unique indexes.
Previous Message Peter Geoghegan 2018-03-31 02:37:38 Re: [HACKERS] A design for amcheck heapam verification