Re: [HACKERS][PATCH] adding simple sock check for windows - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: [HACKERS][PATCH] adding simple sock check for windows
Date
Msg-id CAA4eK1JDacOZnsXftNMYwTztGe9sMYSci--f-zqmd+bAK=WXZA@mail.gmail.com
Whole thread Raw
In response to [HACKERS][PATCH] adding simple sock check for windows  (CharSyam <charsyam@gmail.com>)
Responses Re: [HACKERS][PATCH] adding simple sock check for windows  (CharSyam <charsyam@gmail.com>)
List pgsql-hackers
On Fri, Mar 30, 2018 at 8:10 PM, CharSyam <charsyam@gmail.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


pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: [HACKERS] A design for amcheck heapam verification
Next
From: Peter Geoghegan
Date:
Subject: Re: WIP: Covering + unique indexes.