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

Amit Kapila <amit.kapila16@gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
To: CharSyam <charsyam@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2018-03-31T05:38:37Z
Lists: 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


Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix assorted issues in parallel vacuumdb.